question

Alessio Merlo avatar image
1 Like"
Alessio Merlo asked Phil BoBo answered

Does excelreadcell command work?

Hi,

today writing a procedure to import data from Excel file I discovered a new command excelreadcell. It is recognized by FlexSim, but not by the FlexScript parser. Is it an issue or can't be used?

Does similar command exist to write a variant in Excel file?

Thanks for the support.

FlexSim 18.0.3
excelcommands
parser-error.png (48.0 KiB)
· 4
5 |100000

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

Jeff Nordgren avatar image Jeff Nordgren commented ·

@Alessio Merlo,

Can you send us your model or a sample model that show the problem? Just looking at an error message does not tell us how the model functions. We need to see the model to see what is happening and when.

Also, did you open the Excel file using "excelopen" command? And then do an "excelsetsheet" command? The excelreadcell command does not open the Excel file by itself. My guess is that your Excel file is not getting opened, causing the error?

Thanks.

0 Likes 0 ·
Alessio Merlo avatar image Alessio Merlo Jeff Nordgren commented ·
0 Likes 0 ·
excelreadcell.fsm (16.0 KiB)
Jeff Nordgren avatar image Jeff Nordgren commented ·
@Alessio Merlo

I think the problem was that the Excel file was not being opened. Attached is your model (and the Excel file I used) with the added Excel commands that I used. Seems to work on my end. Does it work for you?

Thanks.

excelreadcell-jn1.fsm

orderschedule.xlsx

0 Likes 0 ·
Alessio Merlo avatar image Alessio Merlo Jeff Nordgren commented ·
@Jeff Nordgren

you don't use excelreadcell command, but excelreadnum. In this way it works!

The excelreadcell command doesn't work because the code isn't compiled correctly then you can't execute it (both with excel file and without excel file).

Probably it is a bug or there is an error in the code.

0 Likes 0 ·

1 Answer

Phil BoBo avatar image
2 Likes"
Phil BoBo answered

For some reason, in the update to compiled FlexScript, excelreadcell() wasn't included in the list of FlexScript commands, so the parser doesn't recognized it.

I've fixed it for 18.0.4, which should be released tomorrow.

5 |100000

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