Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Description

Excerpt

Write-protects the worksheet. A user will not be able to modify the worksheet in Excel without entering the specified password. This method does not encrypt the worksheet.

Signature
C#C#
Wiki Markup
{description}
{excerpt}Write\-protects the worksheet. A user will not be able to modify the worksheet in Excel without entering the specified password. This method does not encrypt the worksheet.{excerpt}
{signature:C#}
 public void Protect(System.String password)
Signature
{signature}{signature:vb.net
vb.net
}
Public Sub Protect(ByVal password As String)
Parameters

...

The password to use to protect the worksheet. If the password is "" or null, the worksheet will be protected without a password.

Remarks

To further protect your spreadsheet, you can protect the Workbook's structure using the Workbook.Protect() method or password encrypt the file using the Workbook.EncryptPassword property.

{signature}
{parameters}
{param:password}The password to use to protect the worksheet. If the password is "" or null, the worksheet will be protected without a password.{param}
{remarks}
To further protect your spreadsheet, you can protect the Workbook's structure using the [Workbook.Protect()|Workbook.Protect(String)] method or password encrypt the file using the [Workbook.EncryptPassword] property.
{remarks}
{example}{code:csharp|title=C#}
ws.Protect("MyPassword");
{code}
{code:vb.net
|title=vb.net
}
ws.Protect("MyPassword"){code}

{example}
Example
Code Block
csharpcsharp
titleC#
Code Block
vb.nettitle