View Full Version : Run .exe from VBA code
kar75
01-02-2007, 07:29 AM
Hi ALL
How to run .exe files from VBA code.
Anand.
Bob Phillips
01-02-2007, 07:41 AM
retval = Shell("C:\Windows\Calc.Exe",1)
Zack Barresse
01-03-2007, 02:06 PM
If you do not want to use the Shell method, you can also use the FollowHyperlink method from any standard module (or UserForm for that)...
Sub TestRunFile()
ActiveWorkbook.FollowHyperlink "C:\YourPath\YourFile.exe"
End Sub
HTH
Ivan F Moala
01-03-2007, 08:02 PM
Zack, the problem with that method is it generates a modal warning msg about hyperlinks being harmfull. I have always prefered Shell or RunDll (to over come this) unless it is a Doc of an Application in which case I would use Shell API to exercute / open in default application.
Zack Barresse
01-04-2007, 09:11 AM
True Ivan, I forgot to mention the warning. Thanks. :)
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.