Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX)) When trying to read sheets

I Have an execl application scope that all the sheets in the excel file, then checks if a sheetname(String) exists in the sheets. The scope start from Reading the excel file - > assinging a workbook variable - > then inside the scope an If statement with condition WBExcelFile.GetSheets.Contains(SheetName)
if true do nothing, if yes, create sheet. Problem is, it sometimes gives an error of Invalid Index. I don’t know what’s giving the problem, I hope you can help me. Thank you.


It might be safer to use GetWorkbookSheets activity as the following.


Thanks, I’ll try this.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.