Skip to main content
All docs
V25.1
  • Row

    WriteProtectionOptions.ClearPassword() Method

    Clears the password used to modify a workbook.

    Namespace: DevExpress.Spreadsheet

    Assembly: DevExpress.Spreadsheet.v25.1.Core.dll

    NuGet Package: DevExpress.Spreadsheet.Core

    Declaration

    void ClearPassword()

    Remarks

    The following example removes write-protection from a workbook:

    using (Workbook workbook = new Workbook())
    {
        workbook.LoadDocument("WriteProtectedDocument.xlsx");
        RemoveWriteProtection(workbook);
    }
    // ...
    
    private void RemoveWriteProtection(Workbook workbook)
    {
        if (workbook.DocumentSettings.WriteProtection.IsPasswordProtected)
            workbook.DocumentSettings.WriteProtection.ClearPassword();
    }
    
    See Also