En anden måde kan være følgende :
Private 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
Lav en subroutine
Public Function RunProgram(ByVal rphwnd As Long, ByVal rplpOperation As String, ByVal rplpFile As String, ByVal rplpParameters As String, ByVal rplpDirectory As String, ByVal rpnShowCmd As Long) As Long
RunProgram = ShellExecute(rphwnd, rplpOperation, rplpFile, rplpParameters, rplpDirectory, rpnShowCmd)
End Function
Kald funktionen :
retval = RunProgram(Me.hwnd, "open", FILNAVN, vbNull, STIEN, 1)
Jeg vil gerne have at mit program skal kunne start et andet program med nogle parametre.
fx: C:\\IEXPLORER:EXE -parametre
Hvordan gøres dette?
mvh Magnus Boye