Free Support Forum -

Disable AutoFilter while formatting a list object (table)


How to disable “AutoFilter” while formatting a list object (table).
I am applying one of the predefined styles in TableStyleType.


Thanks for your posting and using Aspose.Cells.

Please set the ListObject.AutoFilter.Range to null, then it will disable the autofilter on your table.

Please see the following sample code. I have attached the source excel file used in this code and the output excel file generated by it for your reference.


string filePath = @“D:\Downloads\source.xlsx”;

Workbook workbook = new Workbook(filePath);

Worksheet worksheet = workbook.Worksheets[0];

ListObject lobj = worksheet.ListObjects[0];

lobj.AutoFilter.Range = null;


It works!

Thank you.


Good to know that your issue is sorted out now. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.

Thank you.