How to check particular name sheet exist or not in 5 excels

Hi Everyone,
I have 5 manager excels with team member name sheets
I want to search team member sheet is exist or not and if exist go to that sheet
and read that sheet
can anyone help me out here, I am new to excel automation

1 Like


You can use GET WORKBOOKSHEETS Activuty and get the list of sheet names as a List variable
Then use a IF condition like this to check whether the name u want is there in list variable or not

list_variable.Contains(“your name”)

Have a view on this for an example

Cheers @panguluri_saritha

thank you @Palaniyappan but I want search in 5 dynamic excels like eg Team Manager Tracker Ganesh September.xlsx, in all these 5 excels we have to check that Ganesh sheet exist or not
Could you please you suggest the code

Hi, upto Tracker its consistent, name and current month would be dynamic


Use a assign activity like this

arr_files = Directory.GetFiles(“your file path”)

Where arr_files is a variable of type array of string

Now use a for each loop and pass this arr_files as input and change the type argument as string
Inside the loop you can follow the same step as mentioned above


If u r trying with modern activities you can loop through all files in a folder with this activity

Cheers @panguluri_saritha


arr_files is the array of string
use for each for excel files
2.inside use excel application scope inside use get workbook sheets
3.use if condition
booloutput=outputsheets.Any(Function(x) x.ToString.Equals(“sheetname”))

gives boolean value
in then block
use read range activity to read the sheet



Get workbook sheets activity(output : Collection of sheets) ,
after that verify if the collection contains particular sheets
Like, Col_Sheets.Contains(“InlutSheetName”)

If you want index,

solution by @Gangadhar_Athili