SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Function promptUnlockProtectedRanges

    • Excel's Unlock Range dialog: asks for the password of a protected range and grants session access to it (IProtectedRange.unlock).

      Parameters

      • notifier: IReactNotifier | null | undefined

        The host's notifier; without one there is no way to ask, and this resolves false.

      • ranges: readonly IProtectedRange[]

        The ranges in question — typically the ones covering one cell. Those that need no password, or are already unlocked, are ignored.

      Returns Promise<boolean>

      true when the cell is editable afterwards — every range was already open, or the password matched at least one of them. false on cancel.

      A wrong password keeps the dialog open with a message rather than closing it and re-asking, so the check runs inside the dialog's submit validation — where an async password derivation belongs (the dialog shows a spinner while it runs).

      When several password-bearing ranges cover the cell, one password is asked for and tried against all of them: ANY covering range being unlocked is what makes the cell editable (Excel's rule, and the write path's), so there is no reason to ask which.