question

Aniket Singh avatar image
0 Likes"
Aniket Singh asked Aniket Singh commented

How to export global table values to an existing Excel file?

Hi FlexSim Team,

I am using the dashboard button to export the values from a global table to an existing Excel file, as a new sheet. Could you please help me with the example code for the same?

Thanks and Regards,

Aniket Singh

FlexSim 22.2.4
export data
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
0 Likes"
Felix Möhlmann answered Aniket Singh commented

A simple example that let's you export an entire table would be the following.

  1. excelopen("FilePath");
  2. excelcreatesheet("NewSheet");
  3. excelsetsheet("NewSheet");
  4. excelexporttable("GlobalTable1", startRow, startCol, numRows, numCols);
  5. excelclose(1);

You can also write values cell by cell, for example to copy row and column headers. I'd suggest you look through the relevant commands (starting with "excel") to see what's possible.

https://docs.flexsim.com/en/22.2/Reference/CodingInFlexSim/CommandReference/CommandsIndex.html

· 3
5 |100000

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