Table of Contents

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

XLSTalk is deprecated (see GAMS 36 MSAppAvail, Shellexecute, XLSTalk release notes). Please use $libInclude win32 XLSTalk instead.


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



Excel file name with file extension


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


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

execute 'xlstalk.exe -X';

Scalar x;
x = errorLevel;
display x;