So I'm having an issue with the worksheets existing AutoFilter not updating its FilterRange after I import data using worksheet.ImportDataTable.
In my use case, I have the worksheet that has an existing table that comes in as a worksheet.ListObject with an already defined AutoFilter.FilterRange set to worksheet.Range["B8:O9"];
I use worksheet.ImportDataTable(table, false, range.Row, range.Column, false); and the data is imported correctly. However, the AutoFilter.FilterRange is not updated to the new LastRow.
I've tried updating the range by using worksheet.ListObjects[0].AutoFilter.FilterRange = worksheet.Range["B8:O10"];
But the FilterRange doesn't update. I also noticed that the worksheet.ListObjects[0].Location was not updated to the last row of data either.
There's no AutoFilter on the worksheet object either. It seems to be isolated to just the ListObject table.
Is there any way around this? Should I remove the AutoFilter from the ListObject and move it to the worksheet object?