Failed to connect to Excel to get data from __.xlsx

Use this forum to post Vensim related questions.
Post Reply
egrdavie
Junior Member
Posts: 8
Joined: Tue Mar 23, 2010 12:40 am
Vensim version: DSS

Failed to connect to Excel to get data from __.xlsx

Post by egrdavie »

I receive a strange error in trying to retrieve date from an Excel spreadsheet. The error messages are,
ERROR: Failed to connect to Excel to get data from ___.xlsx.
ERROR: Unable to get data values for {variable name}.
ERROR: Failed to make live links to data - aborting simulation.
ERROR: Unable to correctly load in exogenous values - aborting.

The strange thing is that the error occurs only in one model. If I create a different, very simple model and use the same GET XLS DATA call, the model imports the necessary data without any errors. The function call is,
GET XLS DATA( '?{file pointer}' , 'sheet name', 'A' , 'D2' ). (In my case, the file pointer is '?ALI Municipal'.)

Any idea why the model cannot read the data? Calls to the same spreadsheet through GET XLS CONSTANTS work fine. The sheet name in question is the first of three sheets in the file. GET XLS CONSTANTS calls refer to a different sheet in the Excel file.

I am using Vensim version DSS 9.0.0.
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: Failed to connect to Excel to get data from __.xlsx

Post by Administrator »

We'd need to see the model/spreadsheet to be able to help. Most likely it's a typo somewhere (it usually is).
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Failed to connect to Excel to get data from __.xlsx

Post by tomfid »

Using the ? operator prevents most filename typos, though I guess the cell reference could be wrong.

Another possibility is that you're using the DIRECT protocol for GET XLS (see Tools>Options>Settings) and the file is locked because it's open in Excel.
egrdavie
Junior Member
Posts: 8
Joined: Tue Mar 23, 2010 12:40 am
Vensim version: DSS

Re: Failed to connect to Excel to get data from __.xlsx

Post by egrdavie »

There were some typos in the '?{filename}' settings, but I have corrected those. One previous error type was a space between the ? and the filename, but those errors are now corrected. There were also quite a few ? aliases, since different people have worked on the model over the past few years. Now there are only a few of those aliases.

I checked the DIRECT protocol. It's set for OLE.
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Failed to connect to Excel to get data from __.xlsx

Post by tomfid »

Did these changes fix the problem, or is it still failing to read some links? I think we'd need a copy of the model for further diagnosis.

Switching to DIRECT mode is more reliable, but you can't have the spreadsheet open when the model runs (Excel is hostile about file locking).
egrdavie
Junior Member
Posts: 8
Joined: Tue Mar 23, 2010 12:40 am
Vensim version: DSS

Re: Failed to connect to Excel to get data from __.xlsx

Post by egrdavie »

Unfortunately, the problem persists. Can you please tell me where to send the model? We'd be happy for you to take a look. We will send both the Vensim model and the Excel spreadsheet.
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Failed to connect to Excel to get data from __.xlsx

Post by tomfid »

Vensim at vensim.com.
Post Reply