Is it possiable to run another VB program from within vb.
I want it so when a button is clicked to run another vb.exe on (c:\winnt\userid.exe)
Thanks
Printable View
Is it possiable to run another VB program from within vb.
I want it so when a button is clicked to run another vb.exe on (c:\winnt\userid.exe)
Thanks
Place this in the click event of the command button.
call Shell(c:\winnt\userid.exe,3)
"3" stands for maximize.
Look in your VB help file under "Shell Constants" and "Shell Function".
I always prefer to use the ShellExecute API function.
Code: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
Const SW_SHOWNORMAL = 1
Private Sub Form_Load()
ShellExecute Me.hwnd, vbNullString, "c:\winnt\userid.exe", vbNullString, "C:\", SW_SHOWNORMAL
End Sub