0

I am connecting to excel for solving a problem. I had used the same .mod file to solve a example with 5 rows of excel data. Now I am trying with an excel of 266 rows of data. I get an error "Excel size of range is not the size of the array" for the "demand". Can anyone please tell me what may be causing this.

The dat file is here : https://drive.google.com/drive/folders/1FOe8j8uGjxsqFNojpgrCRFB8Y21cEKp4?usp=sharing

The excel file: https://docs.google.com/spreadsheets/d/1hKBMSOEmu8uG1Rv6gjFlPghSLVwAii0TFaxii3wxQFQ/edit?usp=sharing

I have carefully checked and ensured that these ranges totally match but it still shows the same error.

Besides, I have turn excel file into "csv" then manually input and instead of the error above, it seems to read only 265 from "warehouses"

Please help me. Thank you for your consideration

1 Answers1

0

You got the error because you have doublons in Customers!

If I write .mod

{string} Customers =...;// J

string s[1..266]=...;

int nb[c in Customers]=sum(i in 1..266:s[i]==c) 1;


{string} doublons={c | c in Customers:
2<=nb[c]};

execute
{
  writeln(doublons);
} 

and .dat

SheetConnection excel("SCDA.xlsx");

Customers from SheetRead(excel,"'RunningModel2'!B269:JG269");

s from SheetRead(excel,"'RunningModel2'!B269:JG269");

I get

{"TamDuong"}

I you rename one TamDuong to TAmDuong2 you will go further

Alex Fleischer
  • 9,276
  • 2
  • 12
  • 15