ReadonlyisFor runtime type checking.
ReadonlyisFor runtime type checking.
Add Listeners.
Optionaloptions: IListener.OptionsVerifies if the provided password matches the current protection password.
Optionalpassword: string
The password to check against the current protection.
true if the password is correct, false otherwise.
Retrieves the protection properties for the sheet.
The ISheetProtection.Properties the sheet protects with, kept while it is
unprotected, or null when it has none.
Returns true if the protection has a password.
Checks if the AutoTable functionality is protected on the sheet.
true if AutoTable is locked, false otherwise.
Checks if deleting columns is protected on the sheet.
true if deleting columns is locked, false otherwise.
Checks if deleting rows is protected on the sheet.
true if deleting rows is locked, false otherwise.
Checks if formatting cells is protected on the sheet.
true if formatting cells is locked, false otherwise.
Checks if formatting columns is protected on the sheet.
true if formatting columns is locked, false otherwise.
Checks if formatting rows is protected on the sheet.
true if formatting rows is locked, false otherwise.
Checks if inserting columns is protected on the sheet.
true if inserting columns is locked, false otherwise.
Checks if inserting hyperlinks is protected on the sheet.
true if inserting hyperlinks is locked, false otherwise.
Checks if inserting rows is protected on the sheet.
true if inserting rows is locked, false otherwise.
Checks if objects (e.g., charts, shapes) are protected on the sheet.
true if objects are locked, false otherwise.
Checks if the object has a locked but is paused.
true if the object is locked but paused, false otherwise.
Checks if pivot tables are protected on the sheet.
true if pivot tables are locked, false otherwise.
Checks if scenarios are protected on the sheet.
true if scenarios are locked, false otherwise.
Checks if formulas may be shown on the protected sheet.
false if the sheet hides its formulas while protected.
Checks if sorting is protected on the sheet.
true if sorting is locked, false otherwise.
Locks the object (workbook or sheet or range) with the specified options and password.
Optionalproperties: Partial<ISheetProtection.Properties>
The properties to allow to remain unlocked. Omitted, the options the object already carries are used (see unlock and setProperties).
Optionalpassword: string
The password required to unlock the object.
Optionalalgorithm: string
The algorithm for encrypting the password.
OptionalspinCount: number
The spin count for encrypting the password.
The IProtection instance for method chaining.
Temporarily disables protection with the provided password.
Optionalpassword: string
The password required to pause protection.
The IProtection instance for method chaining.
This method allows temporarily pausing protection without permanently unlocking the object. Use resume to restore protection.
Not a shortcut for unlock, even on a lock without a password: unlocking is a document change (the file saves unprotected, and the password is gone), whereas a pause keeps the whole configuration - password, options, and any session access already granted to an IProtectedRange - and resume restores it exactly. The password is required only when one is set. Throws when the object is not locked.
The paused state is session-only and is never serialized.
Resumes protection that was previously paused.
The IProtection instance for method chaining.
This method restores protection after it was paused using the pause method.
Replaces the options of an unprotected or paused object. On a paused object they apply when it resumes; on an unprotected one, when it is next locked.
The properties to allow to remain unlocked.
The IProtection instance for method chaining.
Throws while the object is locked: unprotect or pause first. Neither asks for the password here, since an unprotected object has none and a pause already asked for it.
Unlocks the object (workbook or sheet) using the provided password.
Optionalpassword: string
The password required to unlock the object.
The IProtection instance for method chaining.
If the correct password is provided, protection is removed from the object and the password is cleared. The options are kept, and saved, so a later lock with no properties protects the same way again.
Interface representing the protection settings for a sheet. Extends the base
IProtectioninterface with additional sheet-specific protection options.