Hi ALL
How to run .exe files from VBA code.
Anand.
Hi ALL
How to run .exe files from VBA code.
Anand.
[vba]
retval = Shell("C:\Windows\Calc.Exe",1)
[/vba]
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)...
[VBA]Sub TestRunFile()
ActiveWorkbook.FollowHyperlink "C:\YourPath\YourFile.exe"
End Sub[/VBA]
HTH
Regards, Zack Barresse
Check out the KB! :|: BOARD TAGS: WHAT ARE THEY AND HOW DO I USE THEM
What is a Microsoft MVP? | Free Microsoft Courses | My Book on Excel Tables
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.
Kind Regards,
Ivan F Moala From the City of Sails
True Ivan, I forgot to mention the warning. Thanks.
Regards, Zack Barresse
Check out the KB! :|: BOARD TAGS: WHAT ARE THEY AND HOW DO I USE THEM
What is a Microsoft MVP? | Free Microsoft Courses | My Book on Excel Tables