Workbook.Unprotect

Workbook.Unprotect method

Unprotects a workbook.

public void Unprotect(string password)
ParameterTypeDescription
passwordStringPassword to unprotect the workbook.

Examples

using System;
using Aspose.Cells;

namespace AsposeCellsExamples
{
    public class WorkbookMethodUnprotectWithStringDemo
    {
        public static void Run()
        {
            // Create a workbook with protection
            Workbook workbook = new Workbook();
            workbook.Protect(ProtectionType.All, "book");

            // Unprotect the workbook with correct password
            workbook.Unprotect("book");

            // Save the unprotected workbook
            workbook.Save("unprotected_workbook.xlsx");
        }
    }
}

See Also