Loading

Saturday, February 21, 2009

Runs An Executable Program In Excel VBA Macro

Sometimes, it's very useful to run another application from Microsoft Excel. To runs another application in Microsoft Excel, we can use VBA's Shell function. The following example, will lunch the Notepad application and if the Shell function failed to launch the application, it generates an error.

Sub ExecNotepad()
On Error Resume Next
AppVal = Shell("C:\WINDOWS\NOTEPAD.EXE", 1)
If Err <> 0 Then
MsgBox "Can't start the application.", vbCritical, "Error"
End If
End Sub

SHARE TWEET

Thank you for reading this article Runs An Executable Program In Excel VBA Macro With URL https://x-tutorials.blogspot.com/2009/02/runs-executable-program-in-excel-vba.html. Also a time to read the other articles.

0 comments:

Write your comment for this article Runs An Executable Program In Excel VBA Macro above!