Shell()
Execute another application or task.
Syntax
Shell(cFile, [cParameters], [cDirectory], [nShow]) --> nResult
Arguments
<cFile> --> is the application program to start, for example, "EXCEL"
<cParameters> --> are optional parameters to pass to the application or task.
<cDirectory> --> is an optional parameter that indicates in which directory the application is found. This is the directory path.
<nShow> --> is an optional instruction on how to show the application when it starts. The default value is 1. The range of acceptable values are listed in the following table:
|
Value |
Meaning |
|
0 |
Hide application when starting. (Do not make it visible.) |
|
1 |
Display normally. |
|
2 |
Start as an icon (minimised on taskbar). |
|
3 |
Start maximised (take up full area of display). |
|
4 |
Display but not make it the active window by changing focus. |
While
you may issue a show instruction there is no guarantee that the application or task will obey the request.
Returns
Returns a numeric value. Values between 0 and 31 indicate a failure to execute the program or perform the task. Common error conditions are listed in the table below:
|
Value |
Meaning |
|
0 |
System was out of memory, executable file was corrupt, relocations were invalid, or parameters sent to function were of incorrect format. |
|
2 |
File not found. |
|
3 |
Path not found. |
|
8 |
There was insufficient memory to start the application. |
|
10 |
Windows version was incorrect. |
|
11 |
Executable file was invalid. Either it was not a Windows application or the EXE program was corrupted. |
|
16 |
Attempt to load an application that could not be loaded twice. |
|
20 |
One of the DLL files associated with the application or task was corrupt. |
|
31 |
There is no associated file type or action for the request that Windows can recognise. |
Description
This function is used to start another application or execute a task.
Example
* Open Excel
Shell("Excel")
* Start Windows Explorer
Shell("Explorer")
* Go to CAPITAL web site
Shell("www.capitaloffice.com.au")
* Send an email using your default email software
Shell("mailto:support@capialoffice.com.au")
____________________________
Related Topics: