|
XLSTalk Allows communication with Excel to have it close files, see what version is running and do other functions.
Usage:
xlstalk <option> {-V} <file name> {<other parameters>}
where the parameters are
<file> : Optional Name of the Excel file with the file extension
<option> : One of the following options; see following table:
Option
|
Action
|
Parameter
|
Return code
|
-A
|
Test if Excel is running
|
|
0 if Excel not running, 1 if Excel is running
|
-C
|
Close file; do not save changes.
|
<file name>
|
|
-E
|
Test if file exists
|
<file name>
|
0 if File does not exist, 1 if File exists
|
-M
|
Status of file
|
<file name>
|
0 if file is Not open in Excel
1 if File is open and is not modified
2 if File is open and has been modified
|
-O
|
Open file but do not reload
|
<file>
|
|
-Q
|
Quit Excel if no workbooks have been modified
|
<file>
|
0 if Excel is closed, 1 if Excel is still running
|
-R
|
Run a macro in Excel
|
<file> <macro-name> {<macro-param>}
|
|
-S
|
Save and close the file
|
<file>
|
|
-V
|
Verbose mode
|
|
|
-W
|
Wait for the user to close the file
|
<file>
|
|
-X
|
Excel version
|
|
0 Excel is not installed
1 Excel is installed; version 2003 or earlier
2 Excel is installed; version 2007 or later
|
In GAMS, the return value can be obtained by using 'errorlevel'.
execute 'xlstalk.exe -X';
scalar x;
x = errorlevel;
display x;
|
|