How to get the visible sheets in excel?

Using a “Get workbook Sheets” Activity can get all sheet names, but I don’t want to get the hidden sheets.
Does anyone have a good solution to this problem? Thanks a lot.

1 Like

@asl_johnnyhe - can you please check below

@asl_johnnyhe

Use Balarev activities to unhide the sheets. Please check below thread for the same.

BalaReva.Excel.Activities

1 Like

Thank you for you reply, but I just want to get the visible status of sheets.

Thanks, using "HideUnhide " atctivity just can change but cannot get the status of sheets.

@asl_johnnyhe

Create one workbook variable for Excel application scope activity and get sheet names like this.

WB.getSheets(0) - first sheet
WB.getSheets(1) - second sheet

Etc…

Here, WB is of type workbook variable. The above one will show all list of visible sheets.

1 Like

Thank you again , but if I didn’t know the sheet was hidden, how to foreach every visiable sheets.
I try it out if I “foreach” WB.getSheets(),there are hidden sheets.

2 Likes

after you get the sheet. it stores in an array, therefore you need to assign a variable string to get the sheet.

string abc = sheet(0)

then abc can get first sheet.

2 Likes