ReadonlyisFor runtime type checking.
ReadonlyisFor runtime type checking.
Add Listeners.
Optionaloptions: IListener.OptionsVerifies a plain-text password against the stored hash.
Optionalpassword: string
The password to check.
true when it matches, or when no password is set. false otherwise.
Never throws for a wrong password — unlike IProtection.checkPassword, which is a gate. This is a predicate.
Similar to delete but cleans resources and can't be undone.
Deletes the anchored item.
OptionalgetThe stored password hash, or null if there is none.
Returns the index of this entry within its container.
Unlike IConditionalFormat.getIndex this carries no evaluation semantics — protected ranges are an unordered set in OOXML. The index exists so the UI can present a stable list.
Returns the ranges this object is anchored to, in authored order.
Optionaloptions: ICellRange.GetRangeOptionsnull. An item whose last range was removed by a row/column delete returns an
invalid ranges — ask ICellRanges.isInvalid, the same contract as
ITable.getDataRange.getRange() for it, but data validations, conditional formats and protected ranges are
authored as several, and any single range can become several when a delete splits it.The relative security descriptor, or null if there is none.
Returns true if a password must be supplied to edit this range.
Returns if the model has been closed
Returns if the model has been deleted
If the anchor is unable to be modified.
Whether edits to this range are currently permitted on a protected sheet.
true whenever there is no password — that is the whole point of an entry without one, and
it needs no ceremony.true only after unlock succeeded.Session state, not document state. It is never serialized, never recorded on the undo stack, and resets when the workbook is reopened — the same shape as IProtection.isPaused. This is what lets the write path consult it synchronously; a password check is async and cannot be awaited per cell.
It lasts for one protection period: unprotecting the sheet revokes it (protecting again asks for the password afresh), while a IProtection.pause keeps it. Changing the password revokes it too.
Revokes a previous unlock.
The new name. Must be non-empty and unique within the sheet.
Optionaloptions: ITransaction.OperationOptionsSets (or clears) the password required to edit this range.
The plain-text password, or null to remove it.
Optionaloptions: SetPasswordOptions
Re-anchors this protected range to address, REPLACING every range it currently covers.
The range or ranges to cover — anything ISheet.getRanges accepts
('A1:C20', 'A1:A5, C1:C5', coords). Resolved against this protected range's own sheet.
Optionaloptions: ITransaction.OperationOptions
Transaction options; description names the entry in undo history.
A REPLACE, not an add: the ranges named become the whole anchor. An address that names nothing throws rather than leaving the protected range unanchored — clearing is IAnchored.delete.
Undoable, and refused on a protected sheet. A protected range spans several ranges as readily as
one; the OOXML sqref carries the whole list.
Optionaloptions: ITransaction.OperationOptionsThe current state as a JSON object, or null if there is no state.
Set multiple properties at the same time.
Optionaloptions: ITransaction.OperationOptionspassword here is the already encrypted form — use setPassword to set one from
plain text.
A named range (or set of ranges) that stays editable while the sheet as a whole is protected.
Remarks
Excel surfaces these as Review → Allow Edit Ranges, and OOXML persists them as
<protectedRange>inside<protectedRanges>. Despite the name, a protected range relaxes protection rather than adding it: it is only consulted while ISheetProtection.isLocked is true, and it grants an exemption for the cells it covers — optionally behind a password.sqref="A1:B4 D1:D9"), and any single range can become several when a row/column delete splits it.