Hi,
I have just begun to learn how to use Excel spreadsheets for data input and output in AMPL, but i have a problem with the odbc table handler. Maybe you can help me.
First my system:
-Windows 10 Edu 64-bit
-option version 'AMPL Student Version 20150415 (MS VC++ 6.0, 32-bit)\';
-MS Office 2016 Edu (ProPlus) 64-bit
What works:
-reading a .xls file
-reading/writing a .tab file
What does not work:
a) writing a .xls file
I use a litte test.run script for testung:
set Iteration := {1..5};
param cost {i in Iteration};
let {i in Iteration} cost[i] := round ( Uniform (0,500) );
table test1 OUT "odbc" "test2abc.xls" : Iteration <- [Iteration], cost;
write table test1;
The following error occurs:
ampl: include test.run;
Error at _cmdno 2 executing "write_table" command
(file test.run, line 5, offset 189):
Error writing table test1 with table handler odbc:
DROP TABLE `test1` failed.
Is another application using "test2abc.xls"?
But the file does not exist, so it cannot be in use. Even if i create an empty test2abc.xls the error occurs. Excel is not running.
b) writing/reading a .xlsx file
Same script. The following error occurs:
ampl: include test.run;
Error at _cmdno 2 executing "write_table" command
(file test.run, line 5, offset 190):
Error writing table test1 with table handler odbc:
No suitable driver found.
I remembered to use tableproxy because of 32 bit AMPL and 64 bit Excel: So i downloaded it from
http://www.ampl.com/NEW/TABLEPROXY/tableproxy64.mswin64.zipChanged the table row in my script to:
table test1 OUT "tableproxy" "odbc" "test2abc.xlsx" : Iteration <- [Iteration], cost;
ampl: include test.run;
Error at _cmdno 2 executing "write_table" command
(file test.run, line 5, offset 203):
Error writing table test1 with table handler tableproxy:
Error with proxy table handler: could not load "ampltabl.dll".
But ampltabl.dll is in the AMPL directory. The same error occurs when i try to read a .xlsx file.
Any suggestions?