[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IWorksheet.Protect

Protect Method

Protect(string)

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).

Declaration
void Protect(string password = null)
Sub Protect(Optional password As String = Nothing)
Parameters
Type Name Description
string password

The password used to protect the worksheet, or null to protect it without a password.

Examples
worksheet.Range["A1:B2"].Value = new object[,] {
    {"Name", "Value"},
    {"Test", 100}
};
worksheet.Protect();