Find First Unhidden Sheet Name Of An Excel Using Workbook Activity

Hello Forum,

There is an excel of having 5 sheet i.e.

  • Sheet1 (Hidden)
  • Sheet2 (Hidden)
  • Sheet3
  • Sheet4
  • Sheet5

I want to extract first non-hidden sheet. In this case output should be Sheet3

Thanks,
Ashish

Hi,

Unfortunately, there is no activity to find hidden/visible sheet in Workbook activity. However, we can achieve it using ClosedXML as the following. Can you try this?

workbook.Worksheets.Where(Function(s) s.Visibility=ClosedXML.Excel.XLWorksheetVisibility.Visible).OrderBy(function(s) s.Position).First().Name

Sample20220523-5.zip (11.3 KB)

Regards,

1 Like

Great. Thank you for this.

1 Like

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