TX Sheet Control

SheetProtection.unprotect Method

Method

Removes protection after verifying its password, including modern imported Excel verifiers.

Owner: SheetProtection. Package: @txtextcontrol/tx-sheet-control-server. Version: 2.0.0.

Syntax

await owner.unprotect(password)

Parameters

ParameterTypeOptionalDescription
passwordstring | undefinedYesValue matching password's declared type and the owning object's validation rules.

Return Value

Promise<void>.

Examples

Use a fresh sample workbook for this example. In the browser pass editor.workbook; in Node.js pass the server control. Document-bound objects are obtained from that same owner.

async function applySheetProtectionUnprotect(control) {
    const book = control.workbook;
    const sheetProtection = book.sheets.at(0).protection;
    await sheetProtection.unprotect('sample-edit-password');
}

Remarks

Use this member on an object from the current document. Reacquire document-bound handles after replacement/deletion. Validate arguments against the declared types and documented bounds; handle exceptions or rejected promises.

See Also