question

Flavia P2 avatar image
0 Likes"
Flavia P2 asked hermione12 commented

Export Data to Excel from Flexsim through custom code

Hello everyone,

So i'm trying to export my data from the Statistics Collectors from Flexsim to Excel. I want to do this when the the model stops running so for this I implemented a ModelTrigger to on OnRunStop to execute the node of running a CustomExport.

After this i wrote the code on the Data interface with Excel, like this

So the first part it works, Flexsim runs the custom code after the model stops running but when it starts the export part it does not work and gives all sorts of errors

Opens a window for selecting the xlsx file

Error of closing the excel workbook

Another of that could not open the file

of not set the sheet to Sheet 1, Among others.

Do you have any tips for me on how I can make this work?


FlexSim 19.0.9
flexsim 19.0.9excelexcel exportcostum code
1603297543254.png (347.8 KiB)
1603298226681.png (408.0 KiB)
1603298341415.png (409.4 KiB)
1603298405529.png (503.5 KiB)
1603298475821.png (508.0 KiB)
1603298525442.png (502.4 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

Steven Hamoen avatar image
0 Likes"
Steven Hamoen answered hermione12 commented

@Flavia P2 I think that the "\" in the paths should have an escape character so should actually read \\. So your paths should read C:\\User\\Flavia etc.....

That might solve already quite some problems.

· 8
5 |100000

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