Thanks. I see how I can apply it once I know the range of the heading row - how would I do this given there are varying numbers of columns?
If this was excel, I’d select A10 and go ‘fill to right’ (eg hold down shift while tapping end then right cursor) to highlight all cells. Or I’d say ‘select region’ which highlights the contiguous data area. How do I do this in Aspose Cells so I can use that range to apply the filter?
I think you may use get the last column index which contains data and calculate the last column name by using CellsHelper method dynamically for your needs, see the updated code for your reference.
Sample code:
//Creating a file stream containing the Excel file to be opened
FileStream fstream = new FileStream(“e:\test\book1.xls”, FileMode.Open);
//Instantiating a Workbook object
//Opening the Excel file through the file stream
Workbook workbook = new Workbook(fstream);
//Accessing the first worksheet in the Excel file
Worksheet worksheet = workbook.Worksheets[0];
//Creating AutoFilter by giving the cells range of the heading row