OptionalalgorithmHash algorithm of hashValue as stored in the file, such as 'SHA-512'.
true locks AutoFilter use; false allows it (schema default true).
true locks deleting columns; false allows it (schema default true).
true locks deleting rows; false allows it (schema default true).
true locks formatting cells; false allows it (schema default true).
true locks formatting columns; false allows it (schema default true).
true locks formatting rows; false allows it (schema default true).
OptionalhashBase64 iterated password hash as stored in the file.
true locks inserting columns; false allows it (schema default true).
Optionalinserttrue locks inserting hyperlinks; false allows it. Omitted means true.
true locks inserting rows; false allows it (schema default true).
true locks shapes, charts and other objects; false allows editing them (schema default false).
OptionalpasswordThe legacy 16-bit password hash a file stores (1 to 4 hex digits), never the password
itself: any other value makes the write throw INVALID_WORKBOOK and validate() report
it, and it is not hashed for you, because a password such as 'cafe' is also a valid hash.
Optionalpivottrue locks PivotTable use; false allows it. Omitted means true.
OptionalplainThe password to protect the sheet with, the only field that takes one: on write it
replaces password and the stored hash with a fresh hash (SHA-512, random 16-byte salt,
100,000 iterations, as Excel writes it; modern-xlsx/lite writes the legacy 16-bit
password hash and accepts ASCII passwords only). Write-only: a workbook read back
carries the hash, never this field.
OptionalsaltBase64 salt of hashValue as stored in the file.
true locks scenarios; false allows editing them (schema default false).
Optionalselecttrue blocks selecting locked cells; false allows it. Omitted means false.
Optionalselecttrue blocks selecting unlocked cells; false allows it. Omitted means false.
true protects the sheet: locked cells cannot be edited and the flags below apply.
true locks sorting; false allows it (schema default true).
OptionalspinHash iterations of hashValue as stored in the file.
Sheet protection: the
<sheetProtection>element (ECMA-376 Part 1 §18.3.1.85).Every flag except
sheetsays whether an action is locked while the sheet is protected:trueblocks the action in Excel,falseallows it. Excel enforces the flags only whensheetistrue. An optional flag left out takes the default shown on it, and a workbook read back omits an optional flag that is at its default.To protect with a password, set
plainPassword.passwordand thealgorithmName,hashValue,saltValueandspinCountgroup hold the hash a file carries; they are written back unchanged, and apasswordthat is not 1 to 4 hex digits fails the write.