question

Patrick Zweekhorst avatar image
0 Likes"
Patrick Zweekhorst asked Phil BoBo edited

How to check if an Excel sheet exists?

Hi,

I have written some code to export data from FlexSim to an Excel file.
This all works fine, the only thing I want to know is if I can check if an Excel sheet exists or not.
If you do excelsetsheet on a sheet that does not exist it throws a pop-up. I want to check if the sheet exists and if not create it with excelcreatesheet.

How can I check this without the pop-up msg?

Thank you,

Patrick

FlexSim 19.0.7
excelexportsheet
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

·
Phil BoBo avatar image
0 Likes"
Phil BoBo answered Phil BoBo edited

excelcreatesheet() does nothing if the sheet already exists.

If all you want to do is check if the sheet exists and create it if it doesn't, just use excelcreatesheet(). It checks to see if the sheet exists and then creates it if it doesn't.

5 |100000

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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