question

Liam Chiu avatar image
0 Likes"
Liam Chiu asked Felix Möhlmann commented

How can I fix Excel import error?

Hi,


I am trying to import different excel files for different scenarios. In Model Trigger I use a set of code and set the global variable "Sheet", but when I use the experimenter to experiment, the excel file cannot be read. I am unsure what is causing this.


Thank you for your advance.


1663839496864.png


1663839824120.png


1663839546267.png


1663839954277.png


FlexSim 20.1.3
experimenterexcel
1663839496864.png (92.3 KiB)
1663839546267.png (27.1 KiB)
1663839824120.png (99.5 KiB)
1663839954277.png (379.6 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered Felix Möhlmann commented

Use a forward slash "/" in the file path instead of a backslash "\".

  1. excelopen("D:/Information.xlsx");

Also, based on your screenshots it looks like your global variable "Sheet" should be a string type since you assign the actual sheet name to it in the experimenter. You then also don't need to construct the name in the code.

  1. excelsetsheet(Sheet);

Setting it up like that works without error for me.

1663843063220.png


1663843063220.png (123.4 KiB)
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.