Solved

Error Opening Excel Workbook. No such file or directory

  • 25 November 2019
  • 2 replies
  • 1065 views

Hi.

I tried to follow the tutorial to read the data from excel. I have manually inserted the data for the sets of the index c,t and r in AIMMS. Then, I must set a 3-dimensional parameter, e.g. waste(c,t,r) as shown in the picture below. I wish to insert the data for the parameter by using the axll function in AIMMS.

 

 

 

 I put the excel sheet in the AMMS data folder. I tried using this coding:

 

WorkBookName := "roomWaste.xlsx";

if axll::WorkBookIsOpen(WorkBookName) then
         axll::SelectWorkBook(WorkBookName);
else
         axll::OpenWorkBook(WorkBookName);
endif;


axll::SelectSheet(SheetName : "Waste");


axll::ReadTable(
    IdentifierReference : waste(c,t,r),
    RowHeaderRange      : "A5:A2890",
    ColumnHeaderRange   : "B2:KLH3",
    DataRange           : "B5:KLH2890");


 axll::CloseWorkBook(WorkBookName);
 

 

However, when i tried to run the procedure, there is warning/error as shown below: 

 

 

Can anyone help me with this problem? Thank you in advance!

icon

Best answer by mohansx 25 November 2019, 20:24

View original

2 replies

Userlevel 5
Badge +5

 I put the excel sheet in the AMMS data folder. I tried using this coding:

 

WorkBookName := "roomWaste.xlsx";

 

If your file is in the data folder, then the path must be “data//roomWaste.xlsx”

 

If your file is in the data folder, then the path must be “data//roomWaste.xlsx”

 

It works! Thank you @mohansx 

Reply


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

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