Shell Function

Starts another program and returns the program’s task handle.

Shell (program [, show])

Parameters

Program  -  (Input, expression, Required)

Specifies the name of the executable to run. If a non-string is passed, Error is returned

Show  -  (Input, expression, Optional)

Specifies the window style to begin the program with. If not specified, WinNormal is assumed.
It may be one of the following predefined constants:

Return Value

If the application is successfully started then a value greater than 31 is returned. If the application cannot be started then Error is returned.

Note

Shell starts the executable asynchronously, so the program may not have finished before further actions are executed.

Examples

Shell (“Calc.exe”)

Starts the calculator

Shell (“Notepad.exe”, WinMaximized)

Starts Notepad maximized

Shell (Null)

returns Error

Shell (Error)

returns Error

TIP:

Functions are specifically for use in the Macro Editor. Refer to Microsoft's official VB and JScript documentation for scripting equivalents.

See Also

Functions | Environ function | IsAppRunning function | QBColor function | RGB function | Shell function


© 2004-2021 looksoftware. All rights reserved.