RE: How to determine whether auto filtering is switched on in an Excel Spreadsheet.
In VBA I can use ActiveSheet.AutoFilterMode to determine whether auto filtering is switched on in an Excel Spreadsheet.
How do I achieve this via Aspose.CELLS?
Regards,
Neil.
Hi,
To check whether worksheet has auto-filters or not, see the following sample code:
Aspose.Cells.Workbook wb = new Aspose.Cells.Workbook(“e:\test\Book1.xls”);
Worksheet sheet = wb.Worksheets[0];
AutoFilter autofilter1 = sheet.AutoFilter;
string rtext = autofilter1.Range;
if (rtext == null)
{
MessageBox.Show(“No Autofilters”);
}
else
{
MessageBox.Show(“Autofilters are on”);
}
Thank you.