In this tutorial you will learn how to use the Shell Function.
The Shell function runs an executable program and returns a Variant (Double)
representing the program's task ID if successful, otherwise it returns zero.
=Shell( pathname, windowstyle )
pathname Required. Variant (String). Name of the program to execute and any required arguments
or command line switches; may include directory or folder and drive.
windowstyle Optional. Variant (Integer) corresponding to the style of the window in which the program is to be run.
In this example we will work with the program Notepad.
The result is Notepad Opening.
In a Form add a COMMAND BUTTON control and rename it "cmdShell", then you could add the following in the Click Event.
Private Sub cmdShell_Click()
SHELL "Notepad.exe", vbNormalFocus