Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Description

Excerpt

Protects the workbook structure using the supplied password. End users will not be able to add or remove worksheets unless they enter the password.

Signature
C#
C#
 public void Protect(System.String password)
Signature
vb.net
vb.net
Public Sub Protect(ByVal password As String)
Parameters
Param
password
password

The password to use to protect the workbook. If the password = "" or null, then the workbook will be protected without a password.

Remarks

The equivalent to this action in Excel is to select "Protect structure and windows" from the review menu.

Further protection can be extended to cells by using the Worksheet.Protect() method to protect individual worksheets and by using the Workbook.EncryptPassword property to set a password that must be provided to open the workbook.

Example
Code Block
csharp
csharp
titleC#
wb.Protect("MyPassword");
Code Block
vb.net
vb.net
titlevb.net
wb.Protect("MyPassword")