Importing data from Excel

78 views
Skip to first unread message

Koen

unread,
Apr 25, 2019, 10:07:25 AM4/25/19
to AIMMS - The Modeling System
Dear all,

For my thesis I am investigating whether changing the production location and/or the pickup location of 500 products among 3 factories and 3 warehouses will have influence on the inter-facility transport flows. In order to do so, I wanted to read data from an Excel file, which states the demand of a certain product by a certain customer. Because the Excel file is too big to post here, I've added a Google Drive link: https://drive.google.com/open?id=1-GGcACgnIwPLXsGAOt-2C55ZXK3-lBlM

I've tried doing so with the following code:

WorkBookName := "Sample_demand_data.xlsx";

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

sp_Sheet := "Blad1";
axll::SelectSheet(SheetName : sp_Sheet );

axll::ReadSet(
    SetReference    : Customer_locations,
    SetRange        : "A2:A6086",
    ExtendSuperSets : 1);

axll::ReadSet(
    SetReference    : Products,
    SetRange        : "B1:TB1",
    ExtendSuperSets : 1);    

axll::ReadTable(
    IdentifierReference :  Customer_demand(c,p),
    RowHeaderRange      :  "A2:A6086",
    ColumnHeaderRange   :  "B1:TB1",
    DataRange           :  "B2:TB6086");

axll::CloseWorkBook(WorkBookName);

However, when I try to run the procedure I get the error "the dimension of the first argument of external procedure "axll:ReadTable" is 2 instead of 0."

Does anyone have any reccommendations on what to do?

Thanks in advance, 

Koen

Mohan

unread,
Apr 25, 2019, 1:30:07 PM4/25/19
to AIMMS - The Modeling System
Hello Koen,

That error should be resolved if you compile your project. Press F5 or Run -> Compile.

You can also write the code as

axll::ReadTable(
   
IdentifierReference :  Customer_demand,
Reply all
Reply to author
Forward
0 new messages