SheetProtectionSettings Interface
Editing guard metadata; worksheet protection is not document encryption.
Package: @txtextcontrol/tx-sheet-control. Version: 2.0.0.
Type-only declaration; it is not a JavaScript runtime constructor.
Members
Properties
| Property | Description |
|---|---|
| algorithmName | The algorithmName value of SheetProtectionSettings. |
| allowDeleteColumns | The allowDeleteColumns value of SheetProtectionSettings. |
| allowDeleteRows | The allowDeleteRows value of SheetProtectionSettings. |
| allowEditObjects | The allowEditObjects value of SheetProtectionSettings. |
| allowEditScenarios | Preserved for native Excel scenario editing. |
| allowFilter | The allowFilter value of SheetProtectionSettings. |
| allowFormatCells | The allowFormatCells value of SheetProtectionSettings. |
| allowFormatColumns | The allowFormatColumns value of SheetProtectionSettings. |
| allowFormatRows | The allowFormatRows value of SheetProtectionSettings. |
| allowInsertColumns | The allowInsertColumns value of SheetProtectionSettings. |
| allowInsertHyperlinks | The allowInsertHyperlinks value of SheetProtectionSettings. |
| allowInsertRows | The allowInsertRows value of SheetProtectionSettings. |
| allowSelectLockedCells | The allowSelectLockedCells value of SheetProtectionSettings. |
| allowSelectUnlockedCells | The allowSelectUnlockedCells value of SheetProtectionSettings. |
| allowSort | The allowSort value of SheetProtectionSettings. |
| allowUsePivotTables | Preserved for native Excel PivotTable operations. |
| hashValue | The hashValue value of SheetProtectionSettings. |
| isProtected | The isProtected value of SheetProtectionSettings. |
| passwordHash | The passwordHash value of SheetProtectionSettings. |
| saltValue | The saltValue value of SheetProtectionSettings. |
| spinCount | The spinCount value of SheetProtectionSettings. |
Examples
Create sample data and obtain this detached result from the owning document. Return the selected data to the report or application UI.
import type { Workbook } from '@txtextcontrol/tx-sheet-control';
function createSheetProtectionSettingsReport(book: Workbook) {
const sheet = book.sheets.at(0);
sheet.range('B8:B9').setValues([[120], [80]]);
sheet.cell('B10').setFormula('=SUM(B8:B9)');
sheet.range('B8:B10').format({ numberFormatCode: '#,##0.00', fontSize: 11 });
sheet.protection.protect({ password: 'sample-edit-password' });
const result = sheet.protection.settings;
return result;
}