We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Locking Workbooks

I am trying to lock a workbook to prevent users from editing the workbook.

1) If I use the workbook protect method, I cannot add worksheets etc as expected but I can still edit the workbook.

workbook.Protect( ProtectionType.All, _loggedOnUser.GUID);

2) I have tried locking all columns of a given worksheet and then protecting the sheet but I can still edit the sheet. Any Ideas on how I can achieve my desired end.

Hi,


Please see the topic:
http://docs.aspose.com/display/cellsnet/Protecting+Worksheets

It will help you to achieve your needs.

By the way, Aspose.Cells will allow you to do/perform the same protection options as you can manually do it in MS Excel.

Thank you.

Hi,

Thanks for your question and considering Aspose.Cells.

Please refer to these articles for your help.
Protecting Worksheets
Advanced Protection Settings since Excel XP

OK, I found I had to use the advanced WorkSheet.Protect and set all flags to false and that in addition to proctecting the workbook made verything readonly as required

Hi,

It’s good to know you were able to resolve it. If you have any other questions, please feel free to post, we will help you asap.