Check sheetname.

Is it a way to check if an excel file contains a certain sheet by sheetname? Or what is the best way to do that?
Thanks!

Hi,

You can use
index := xls.GetSheetIndex('name', false);
if index is -1, then the sheet doesn't exists, else it exists and it is at position index.

See http://www.tmssoftware.biz/flexcel/doc/vcl/api/FlexCel.Core/TExcelFile/GetSheetIndex.html

That works! Thanks!