Archive of Mr Excel Message Board


Back to Excel VBA archive index
Back to archive home



How to call an external executable file (.exe) from within Excel 2000

Posted by James on March 09, 2001 6:23 PM
1. How do you call an external executable file (.exe) from within Excel 2000?


Check out our Excel VBA Resources

Re: How to call an external executable file (.exe) from within Excel 2000

Posted by Roger Redhat on March 10, 2001 12:48 AM

Use the Shell function from within a macro. E.g.

Sub Runcalc()
Dim RetVal
RetVal = Shell("C:\WINDOWS\CALC.EXE", 1)
End Sub

The 1 after the path name means that the newly opened application will have the focus and will be displayed as though you had opened it manually.



Re: How to call an external executable file (.exe) from within Excel 2000

Posted by James on March 10, 2001 10:07 AM
This works nicely. Thanks Roger.





This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.