The code example below does allow the worksheet to be autofiltered but how is the worksheet then protected?
When I run this, the autofilter works but the worksheet is not protected. (I'm using excel 2003, Aspose.Cells v4.8.1.0, C#)
Kind regards
Andrew
Laurence:
To enable autofilter while protecting the worksheet, please try:
Excel.Worksheets(0).Protection.IsFilteringAllowed = True
Excel.Save("abc.xls", FileFormatType.ExcelXP)
Please don't use Protect method and save file format as ExcelXP or Excel2003.