gdxxrw error

Post Reply
Rob Davies
User
User
Posts: 25
Joined: 3 years ago

gdxxrw error

Post by Rob Davies »

Using gdxxrw to read an Excel workbook I get an error message

ExceException EOleSysError in module gdxxrw.exe at 000DAD35.
Call was rejected by callee.

I have tried using Rwait, but it has no effect.

Please help
Rob Davies
Fred
Posts: 373
Joined: 7 years ago

Re: gdxxrw error

Post by Fred »

Hi Rob,

Is it possible to share the Excel file and the gdxxrw command such that we can reproduce the issue?
It would also be good to know which GAMS version your are using.

Fred
Rob Davies
User
User
Posts: 25
Joined: 3 years ago

Re: gdxxrw error

Post by Rob Davies »

Dear Fred
Thank you for your help.
I am attaching a zipped file with everything in it.
I have managed to track down that the error is somehow related to the 3OutOLC.xlsx - which is called from the include 2Report2.inc at the bottom of 2Simulation.
I sometimes, but not always, get the same problem with other models.
Rob
Attachments
SA_template - Copy.zip
(1.02 MiB) Downloaded 221 times
Fred
Posts: 373
Joined: 7 years ago

Re: gdxxrw error

Post by Fred »

Hi Rob,

Thanks for sharing. Some instructions on how to actually run this would be helpful.

I assume I first have to run `1modOLC.gms` and then `2Simulation.gms`? Are there any command line parameters that need to be set? It could be helpful if you share the log of a run that shows that failure.

Best,
Fred
Rob Davies
User
User
Posts: 25
Joined: 3 years ago

Re: gdxxrw error

Post by Rob Davies »

Dear Fred
Apologies for that.
Yes - run 1modOLC.gms first, with a save in the command line (s=1mod)
Then 2simOLC.gms with a restart (r=1mod)
You can turn off most of the simulations, which are activated/deactivated on the "Main" sheet of 2simOLC.xlsx.
At the end of 2simOLC.gms is
$INCLUDE includes/2report2.inc
If I star this out, I do not get the problem, so it seems it is something to do with the xlsx files it is calling.
I attach a log. The error is in line 34/35
Best
Rob
2Simulation.log
(201.35 KiB) Downloaded 193 times
Fred
Posts: 373
Joined: 7 years ago

Re: gdxxrw error

Post by Fred »

Hi Rob,

I cannot reproduce this issue. However, were able to trigger a similar exception from the preceding xlstalk call. The weird thing is, that we tried this across multiple machines and the issue is only occurring on some of them. So this has may have something to do with some Excel configuration. We will need to dig deeper. I will keep you posted.

Some further questions/comments.
1. Is this issue reliably reproducible?
2. Can you use gdxxrw at all (e.g. I see some gdxxrw calls in 1modOLC.gms) or does any call of gdxxrw fail.
3. If you had workbooks open in Excel when running the job, can you try whether it makes a diference if you close them manually before starting the job?
4. After closing all workbooks as mentioned under 3, can you please make sure that there are no active EXCEL processes running (Task Manager --> Details). If there are any, please kill them. Does the issue still occur after doing that?
5. As a final experiment, could you reboot your machine, open a cmd in your working directory and run only the gdxxrw call "gdxxrw i=Workbooks\2simOLC.xlsx o=z2simulation.gdx index=index!e6"? Does this fail as well?

Best,
Fred
Rob Davies
User
User
Posts: 25
Joined: 3 years ago

Re: gdxxrw error

Post by Rob Davies »

Dear Fred
I appreciate your help.
I also feel it is more an Excel issue than a GAMS one. In fact I have been trying to see if it is related specifically to the Excel workbook I am trying to read. But I cannot find anything.
For what it is worth I use Microsoft® Excel® for Microsoft 365 MSO (Version 2310 Build 16.0.16924.20054) 64-bit.

1. I cannot easily replicate it. In fact, I am running the model at the moment and it seems fine. However, I notice that when it opens 2simOLC.xlsx it does s as read only. That suggests the workbook is being used elewhere. (see 3/4)

2. I use gdxxrw often in other models without any problem, although this problem arose some time ago when I was working on something else.

3/4. I have taken to shutting them down manually. But looking under task manager > details, there are 6 instances of EXCEL.EXE running:
image.png
I have never looked at details here so do not know how to interpret that. I will reboot after I send this and see what happens.
I will try your suggestion 5 later.
Rob
Rob Davies
User
User
Posts: 25
Joined: 3 years ago

Re: gdxxrw error

Post by Rob Davies »

Hi Fred
I restarted and ran the model again. Now there is only one instance of Excel shown in Task Manager Details.
And when I close the workbooks down manually, those instances disappear.
Clearly something wrong with my Excel. Maybe I need to reinstall.
Thanks for your help.
Best
Rob
Rob Davies
User
User
Posts: 25
Joined: 3 years ago

Re: gdxxrw error

Post by Rob Davies »

Hi.

I am afraid the same error persists after reinstalling Office. So it has to be a problem in GAMS.
This afternoon I got an error message suggesting there is a problem in gdxxrw:

GDXXRW 45.6.0 2eadeefd Jan 4, 2024 WEI x86 64bit/MS Window
Input file : C:\Users\Rob Davies\Desktop\RwandaPrep\SA_template\z0output.gdx
Output file: C:\Users\Rob Davies\Desktop\RwandaPrep\SA_template\Workbooks\3outOLC.xlsx
ExceptioException EOleSysError in module gdxxrw.exe at 000DAD35.
Call was rejected by callee.

It did not export the data to Excel.
Rob
Post Reply