GDXXRWExample13.gms : Reads a Table from Spreadsheet, manipulates the Data and writes back to Spreadsheet

Description

This program reads data from an MS Excel file, modifies
it, writes to an GDX file and then finally writes the
modifies data to a new sheet in the MS Excel file.

This model is referenced in "Reads a table from Spreadsheet, manipulates the
Data and writes back to Spreadsheet" from the GDXXRW Documentation.


Category : GAMS Data Utilities library


Main file : GDXXRWExample13.gms   includes :  GDXXRWExample13.gms  Test1.xls

$title Reads a Table from Spreadsheet, manipulates the Data and writes back to Spreadsheet (GDXXRWExample13,SEQ=025)

$onText
This program reads data from an MS Excel file, modifies
it, writes to an GDX file and then finally writes the
modifies data to a new sheet in the MS Excel file.

This model is referenced in "Reads a table from Spreadsheet, manipulates the
Data and writes back to Spreadsheet" from the GDXXRW Documentation.
$offText

$if %system.filesys% == UNIX $abort.noError 'This model cannot run on a non-Windows platform';
$call msappavail -Excel
$ifE errorLevel<>0 $abort.noError 'Microsoft Excel is not available!';

$call gdxxrw test1.xls dSet=I rng=A2:A3 rDim=1 dSet=A rng=B1:D1 cDim=1 par=X rng=A1:D3 rDim=1 cDim=1 trace=0
$gdxIn test1.gdx

Set I(*), A(*);
$load I A

Parameter X(I,A);
$load X

display I, A, X;
$gdxIn
X(I,A) = - X(I,A);

execute_unload 'tmp.gdx', I, A, X;
execute 'gdxxrw tmp.gdx output=test1.xls par=X rng=EX6!A1:D3 rDim=1 cDim=1 trace=0';