Free Support Forum -

Is there any other way to protect worksheet without password

hi, for some reason, our team would like to protect a worksheet without using password.
the only way we could think of is transferring entire sheet to image and insert it back. However, transfer entire sheet to image might cause some performance issue.
Is there any other way you can suggest?


You may try the following sample code to accomplish the task:
Sample code:

Workbook workbook = new Workbook("Book1.xlsx");
Worksheet worksheet = workbook.Worksheets[0];

Hope, this helps a bit.

hi, thanks for your response.
what does following function do?


it will protect the worksheet with no password? If so, can user ‘unprotect’ this sheet?


Yes, and the user can unprotect it in MS Excel by using Review|Unproect Sheet option in MS Excel manually. For Aspose.Cells to unprotect the sheet, he may use Worksheet.Unprotect() method in code.

hi, is there anyway user is not able to unprotect this sheet by using this function?


No. That’s why it is always recommended to set password while protecting sheets or workbooks. In short, you got to protect the sheet with a password for safety.

understand! thank you. :slight_smile:


You are welcome.