How to run an exe file from VB 6

You can use of Shell function in vb 6 to run any external executable file from vb 6 code.


You can use shell function in vb 6 as:
Function Shell(PathName, [WindowStyle As VbAppWinStyle = vbMinimizedFocus]) As Double

Shell function is the member of VBA.Interaction that runs an executable program


In the following example we run the notepad application through Shell function on the CommanButton click event.

Private Sub Command1_Click()
   Dim RetVal
   RetVal = Shell("notepad.exe", 1)
End Sub