Check Excel sheet exist or not

How can I check in my excel file sheet exist or not…?

Set a Boolean type variable to File.Exists(MyFilePath), where MyFilePath is a string containing the path of your excel file. The variable will be set to True if it exists or False otherwise.

I want to check sheet name not file

Use an Excel Application Scope activity on the path of the file, and then use the Get Sheets activity to get an array of strings representing the names of each sheet. Then use MySheets.Contains(SheetName), where MySheets is the array you retrieved from the Get Sheets activity, and SheetName is a string set to the name of the sheet you’re checking for.

1 Like

Hey Anthony,

the person who asked the original question may not have marked this as the solution, it sure solved my similar question. I knew it could be done but not sure how so thanks for the hint. :slight_smile: Much appreciated.

– Finn

1 Like