Part | Description | |
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. If windowstyle is omitted, the program is started minimized with focus. |
Constant | Value | Description | |||||
vbHide | 0 | Window is hidden and focus is passed to the hidden window. | |||||
vbNormalFocus | 1 | Window has focus and is restored to its original size and position. | |||||
vbMinimizedFocus | 2 | Window is displayed as an icon with focus. | |||||
vbMaximizedFocus | 3 | Window is maximized with focus. | |||||
vbNormalNoFocus | 4 | Window is restored to its most recent size and position. The currently active window remains active. | |||||
vbMinimizedNoFocus | 6 | Window is displayed as an icon. The currently active window remains active. |
Part | Description |
pathname | On the Macintosh, you can use the MacID function to specify an application's signature instead of its name. The following example uses the signature for Microsoft Word: |
Shell MacID("MSWD") | |
windowstyle | On the Macintosh (System 7.0 or later), windowstyle only determines whether or not the application gets the focus when it is run. |
' In Microsoft Windows:
' Specifying 1 as the second argument opens the application in
' normal size and gives it the focus.
Dim RetVal
RetVal = Shell("C:\WINDOWS\CALC.EXE", 1) ' Run Calculator.
' On the Macintosh:
' Both statements launch Microsoft Excel.
RetVal = Shell("Microsoft Excel") ' Specify filename.
RetVal = Shell(MacID("XCEL")) ' Specify signature.