So, I’m doing some searching in an Excel document, but it is very common for others to turn on filters and leave them on. When those filters are on, those cells are not included in the worksheet’s Cells range.
Is there a way to turn off these custom filters so that I can still get to all of the cells in the sheet?
This is the way I use to find the method
Microsoft.Office.Interop.Excel.Range find = sheet.Cells.Find(tapeID, Type.Missing,
Microsoft.Office.Interop.Excel.XlFindLookIn.xlValues, Microsoft.Office.Interop.Excel.XlLookAt.xlPart,
Microsoft.Office.Interop.Excel.XlSearchOrder.xlByRows, Microsoft.Office.Interop.Excel.XlSearchDirection.xlNext, false, Type.Missing, Type.Missing);
When the filters are on, I get a null object returned and can’t do anything but with the filters off, I get what I need.
Any hints on turning the filters off?
I would test first to see if a filter has been applied and then deactivate it if it has:
That should remove any filtering that has been applied and remove the filter arrow buttons.