The following code results in an InvalidCastException when the Workbook contains a table where a column is filtered by the date. At example workbook is attached.
```
new XLWorkbook(@"C:\Scratch\DateFilter example.xlsx")
```
The full details of the exception are:
```
Unable to cast object of type 'DocumentFormat.OpenXml.Spreadsheet.DateGroupItem' to type 'DocumentFormat.OpenXml.Spreadsheet.Filter'.
at ClosedXML.Excel.XLWorkbook.LoadAutoFilterColumns(AutoFilter af, XLAutoFilter autoFilter)
at ClosedXML.Excel.XLWorkbook.LoadSpreadsheetDocument(SpreadsheetDocument dSpreadsheet)
at ClosedXML.Excel.XLWorkbook.LoadSheets(String fileName)
at ClosedXML.Excel.XLWorkbook..ctor(String file)
```
Comments: ** Comment from web user: rhysparry **
```
new XLWorkbook(@"C:\Scratch\DateFilter example.xlsx")
```
The full details of the exception are:
```
Unable to cast object of type 'DocumentFormat.OpenXml.Spreadsheet.DateGroupItem' to type 'DocumentFormat.OpenXml.Spreadsheet.Filter'.
at ClosedXML.Excel.XLWorkbook.LoadAutoFilterColumns(AutoFilter af, XLAutoFilter autoFilter)
at ClosedXML.Excel.XLWorkbook.LoadSpreadsheetDocument(SpreadsheetDocument dSpreadsheet)
at ClosedXML.Excel.XLWorkbook.LoadSheets(String fileName)
at ClosedXML.Excel.XLWorkbook..ctor(String file)
```
Comments: ** Comment from web user: rhysparry **
Thanks @Ged325.
I've attached my patch which works in a similar way to yours except using the OfType<T>() extension method to do the necessary filter filtering by type. Like you I only need the data which seems to be workable with the solution and so far doesn't seem to make things any worse than they already are.