[]
Protects a worksheet so that it cannot be modified.
Use this method to apply worksheet protection without passing a password. To remove the protection later, use Unprotect(string).
void Protect(string password = null)
Sub Protect(Optional password As String = Nothing)
| Type | Name | Description |
|---|---|---|
| string | password | The password used to protect the worksheet, or null to protect it without a password. |
worksheet.Range["A1:B2"].Value = new object[,] {
{"Name", "Value"},
{"Test", 100}
};
worksheet.Protect();