Skip to content

wb.protection

WorkbookProtection

4 methods

isProtected

Promise<boolean>
isProtected(): Promise<boolean>;

Check if the workbook structure is currently protected.

getOptions

Promise<WorkbookProtectionOptions | null>
getOptions(): Promise<WorkbookProtectionOptions | null>;

Get the current protection options, or null if the workbook is not protected.

protect

Promise<void>
protect(password?: string, options?: Partial<WorkbookProtectionOptions>): Promise<void>;
ParameterTypeRequired
passwordstringoptional
optionsPartial<WorkbookProtectionOptions>optional

Protect workbook structure with optional password and options.

unprotect

Promise<boolean>
unprotect(password?: string): Promise<boolean>;
ParameterTypeRequired
passwordstringoptional

Unprotect the workbook. Returns true if successful (password matches).