Import Excel tables with GDXXRW

Hello guys,

I’m trying to import a table from a xls/xlsx file. To begin with, I just tried to import and print, but the result is an empty table:
( ALL 0.000 )
Below, the code:

SET
p /p1*p11/
Icolumns /Invest, VPL/;

VARIABLES
Z
MAXVPL(p)

Input(p, Icolumns)
;

*=== First unload to GDX file (occurs during compilation phase)
$CALL GDXXRW.EXE data.xls par=Level rng=A1:C12
*=== Now import data from GDX
Parameter Level(p, Icolumns);
$GDXIN data.gdx
$LOAD Level
$GDXIN
*=== Fix variables to values from Excel file
Input.FX(p, Icolumns) = Level(p, Icolumns);
display Input.L;

Thanks for help,
Hugo.


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Hugo

Without the excel sheet, it is hard to say what is happening.

You can add “Trace=3” at the end of the gdxxrw line, so you will get more information on what is going on.

Cheers

Renger


Modelworks

Gewerbestrasse 15

3600 Thun – Switzerland

+41 79 818 53 73

Info@modelworks.ch

blog.modelworks.ch







From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Hugo Hiroshi Yamamura
Sent: Montag, 27. Januar 2014 19:02
To: gamsworld@googlegroups.com
Subject: Import Excel tables with GDXXRW



Hello guys,

I’m trying to import a table from a xls/xlsx file. To begin with, I just tried to import and print, but the result is an empty table:
( ALL 0.000 )
Below, the code:

SET
p /p1*p11/
Icolumns /Invest, VPL/;

VARIABLES
Z
MAXVPL(p)

Input(p, Icolumns)
;

*=== First unload to GDX file (occurs during compilation phase)
$CALL GDXXRW.EXE data.xls par=Level rng=A1:C12
*=== Now import data from GDX
Parameter Level(p, Icolumns);
$GDXIN data.gdx
$LOAD Level
$GDXIN
*=== Fix variables to values from Excel file
Input.FX(p, Icolumns) = Level(p, Icolumns);
display Input.L;

Thanks for help,
Hugo.


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.