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.
Best answer by Gertjan
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
Also attached a newer version of the example that is a little fancier (
- 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.