Free Support Forum - aspose.com

Autofilter while Worksheet Is Locked / Protected

Dear Aspose Team,

How to set autofilter while the worksheet is locked / protected?? Is it possible??

FYI, I protect the worksheet with this code :

Excel.Worksheets(0).Protect(ProtectionType.All)

And after I put that code, autofilter cannot be used.

Please Help Me..

Thank You

Didik Setiawan

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.

The autofilter is now working as I would expect it to.

Thanks for the answer, keep up the great work.

Regards,

Didik Setiawan