Worksheet.Unprotect

Unprotect()

Unprotects worksheet.

public void Unprotect()

Remarks

This method unprotects worksheet which is protected without password.

See Also


Unprotect(string)

Unprotects worksheet.

public void Unprotect(string password)
ParameterTypeDescription
passwordStringPassword

Remarks

If the worksheet is protected without a password, you can set a null value or blank string to password parameter.

Examples

// Called: workbook.Worksheets[0].Unprotect("test");
public void Worksheet_Method_Unprotect()
{
    Workbook workbook = new Workbook(Constants.sourcePath + "example.xlsb");
    workbook.Save(Constants.destPath + "example.xlsb");
    workbook = new Workbook(Constants.destPath + "example.xlsb");
    workbook.Worksheets[0].Unprotect("test");
}

See Also