I am using the AutoFilter () method without any problems. but I could not mark or get a range of filtered rows, count / copy / delete them.
I saw a lot of posts about this issue with VBA, but none of them are for C #.
After filtering, I tried to get a range by any of these lines:
range = ws.UsedRange.CurrentRegion.SpecialCells(Excel.XlCellType.xlCellTypeVisible, missing);
range = ws.AutoFilter.Range.SpecialCells(Excel.XlCellType.xlCellTypeVisible, missing);
range = ws.Cells.SpecialCells(Excel.XlCellType.xlCellTypeVisible, missing);
And I even tried other ways that I don’t even remember.
After marking the range, I tried to count the lines by doing:
range.Rows.Count
and in each case I got the total number of lines of the sheet, sometimes I got 65536 (office 2003), and sometimes only 1, but, of course, not the number of lines that I filtered.
I have to use it with Office 2003 with an object library.