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

    Interface ICellProtection

    The protection format of a cell: whether it stays editable, and whether it shows its formula, while its sheet is protected.

    • Part of the style, so it travels with the format — copy, paste, fill and named styles carry it, and clearing formats resets it.
    • Only consulted while the sheet is protected. ICell.isEditAllowed and ICell.isFormulaHidden combine it with the sheet's protection and its unlocked ranges.
    interface ICellProtection {
        isICellProtection: true;
        isAlwaysUnlocked(): boolean;
        isShowFormulas(): boolean;
        setAlwaysUnlocked(
            alwaysUnlocked: boolean | null,
            options?: UpdateOptions,
        ): ICellProtection;
        setShowFormulas(
            showFormulas: boolean | null,
            options?: UpdateOptions,
        ): ICellProtection;
        toJSON(): ICellProtection.JSON;
    }
    Index
    isICellProtection: true

    For runtime type checking.

    • Returns true if the cell stays editable when its sheet is protected.

      Returns boolean

      • This is Excel's Locked format, inverted.
      • It never asks for a password, even inside a password-protected unlocked range. An unlocked range is the other way to make a cell editable; either one is enough.
      false
      
    • Returns true if the cell's formula stays visible on a protected sheet that hides formulas.

      Returns boolean

      • An exception, like isAlwaysUnlocked: a formula shows when the sheet (ISheetProtection.isShowFormulasAllowed) or the cell allows it, so this only matters while the sheet hides them.
      • A hidden formula reads as no formula (ICell.getFormula is null), but it still calculates and is still saved with the workbook. It is a view rule, not secrecy.
      false
      
    • Sets whether the cell stays editable when its sheet is protected.

      Parameters

      • alwaysUnlocked: boolean | null

        true to keep the cell editable. null to clear.

      • Optionaloptions: UpdateOptions

      Returns ICellProtection

    • Sets whether the cell's formula stays visible on a protected sheet that hides formulas.

      Parameters

      • showFormulas: boolean | null

        true to keep the formula visible. null to clear.

      • Optionaloptions: UpdateOptions

      Returns ICellProtection