GAMS [ Home | Downloads | Documentation | Solvers | APIs | Tools | Model Libraries | Resources | Sales | Support | Contact Us | Search ]

XLSTALK

Table of Contents

XLSTalk is not a GDX utility, but as the program is often used with GDXXRW, it is discussed here.

Usage

xlstalk <option> {-V} <file> {<parameters>}

where

<file>

Excel file name with file extension

<option>

One of the following options; see following table:

Option Action Parameter Return code
-A Test if Excel is running 0 Excel not running
1 Excel is running
-C Close file; do not save changes. <file>
-E Test if file exists <file> 0 File does not exist
1 File exists
-M Status of file <file> 0 Not open in Excel
1 File is open and is not modified
2 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 Excel is closed
1 Excel is still running
-R Run a macro <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

Example

In GAMS, the return value can be obtained by using 'errorlevel'.

execute 'xlstalk.exe -X';
scalar x;
x = errorlevel;
display x;