$title Combined Heat and Power Generation $onText In this example GAMS runs only in the background. We use gdxxrw to write a GDX file from data defined in the spreadsheet.With the vba version of the option object API we set several GAMS options from vba and solve the model using the gams executable. At the end the solution is written into a user defined workbook using gdxxrw again. $offText $callTool win32.msappavail Excel $if errorlevel 1 $abort.noError "No Excel available" $call "start chp.xlsm"