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

    Function useWorkbookEncrypted

    • Tracks whether a workbook is — or, once saved, will be — encrypted, as React state.

      Parameters

      • workbook: IWorkbook | null

        The workbook to track, or null.

      Returns boolean

      true when the file is encrypted or a password has been set for it.

      Reads Origin.isEncrypted(), which covers both: a read or a completed write records what is on disk, and Origin.setPassword records the intent immediately — the same latitude Origin.setName has. One source, one onChange to follow, so a lock appears the moment a password is set rather than only after the save that applies it.