Skip to main content

I am a beginner. I have created my model and now I need to read data from Excel. I have tried following the “ReadingExcelData.ams” example and specifically AXLL, but it doesn't work and keep getting this error:

“The first argument of internal procedure "ReadUsingAXLL" must be an explicit identifier.”

In fact, when I run the “ReadingExcelData.ams” example itself, it doesn't show me the data that model was supposed to read from excel. so my second question is how should I get the example work?

Really appreciate any help with this.

Thanks

Did you take a look at the NFL example stated in https://how-to.aimms.com/Articles/85/85-using-axll-library.html (also attached here). This should run smoothly; I just tried it myself. See procedures prReadFromExcel and prWriteToExcel.

 

Also attached a newer version of the example that is a little fancier (_new.zip):

  • opens up the WebUI at the start
  • added button to read/write data from/to Excel
  • added a distance table 
  • added unit ‘miles’ to distance

PS: Be sure to keep the XLS file closed, else it produces the error ‘OpenWorkbook : Error opening workbook 'input.xlsx': Permission denied.


Thanks so much for the response. It worked. 

I actually have another question, if you dont mind. I need matrix format for some of my parameters and now I know how to read matrix from excel. However, I was wondering if I could read my data in a table format (rather than matrix) from excel, but transform it into a matrix in AIMMs? This would be helpful for sparse matrices.

 


Reply


Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator