How to identify which cell(s)/column(s) have Filters set?
c#, cell, excel, interop
Solution
- The `Worksheet` interface has an `AutoFilter` property that returns an `AutoFilter` interface.
- The `AutoFilter` interface has a `Filters` property that returns a `Filters` interface.
- The `AutoFilter` interface has a `Range` property that returns the range being filtered.
- The `Filters` interface is a collection of `Filter`s; these are in the same order as the columns in `AutoFilter.Range`
- The `Filter` interface has an `On` property that indicates whether the column is being filtered.
Problem
I am using Microsoft Interop to read the data. In excel-sheet, multiple random columns have "filters" set. How do I find out which cells /columns have filters set? I would like lo load only the columns that have filters set. here is how the sheet looks like row 1-5, col 1-10 [long text describes the data in the sheet, i do not want to load ] row 1-10, col 1 [some data, not filtered, i do not want to load] row 1-10, col 2-15 [filter set for some columns only, i would like to detect the filters and load the entire column data ]