1
votes
using (var workBook = new XLWorkbook(file)

I'm reading excel xlsx file with already defined filter. Let's say that only rows with text 'abc' in column 2 are shown.

I cannot find any way to read this with ClosedXML. I can see that this filter exists by looking inside worksheet.AutoFilter but I cannot find a way to apply this. All the time I'm getting all rows from the worksheet. I want to get only those that are filtered and displayed when I open it in Excel.

1

1 Answers

0
votes

Depending on version you use, you can do

var visibleRows = worksheet.RowsUsed(x => x.IsHidden == false);

Any rows that is hidden is filtered out.