The shell function will actually return a number. You'll need to add a variable to collect the returned number:
Dim Ret as Long
Ret = Shell ("c:\myapplication.exe argument1 argument2")
-------------------------------------------
Also, ShellExecute and ShellExecuteEx are available in VBA, but you have to declare the functions first. See below:
Const SW_SHOW = 1
Const SW_SHOWMAXIMIZED = 3
Public Declare Function ShellExecute Lib "Shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Sub RunYourProgram()
Dim Ret As Long
RetVal = ShellExecute(0, "open", _
"
", "", _
"", SW_SHOWMAXIMIZED)
End Sub
There are some useful information and tools for API functions here:
http://allapi.mentalis.org/agnet/apiguide.shtml