Run an external executable program and return a Variant (Double) representing the program's task ID if successful, otherwise return zero.
Syntax Shell(pathname [, windowstyle ] )
To run non-executables, shortcuts or programs that require parameters to be passed you can use a simple batch file.
The windowstyle named argument has these values:
Constant | Value | Description |
---|---|---|
vbHide | 0 | Window is hidden and focus is passed to the hidden window. (not applicable on Macintosh platforms.) |
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. |
Example
Dim dblDemo as Double
dblDemo = Shell("C:\programs\demo.cmd", vbNormalFocus)
“Do not run; scorn running with thy heels” ~ Shakespeare, The Merchant of Venice
Related:
RunSQL - Run a Microsoft Access action query.
RunMacro - Run a macro.