ExcelScript.WorksheetProtectionOptions interface
Represents the options in sheet protection.
Remarks
Examples
/**
* This script protects cells from being selected on the current worksheet.
*/
function main(workbook: ExcelScript.Workbook) {
// Get the protection settings for the current worksheet.
const currentSheet = workbook.getActiveWorksheet();
const sheetProtection = currentSheet.getProtection();
// Create a new WorksheetProtectionOptions object with the selectionMode property set to `none`.
let protectionOptions : ExcelScript.WorksheetProtectionOptions = {
selectionMode: ExcelScript.ProtectionSelectionMode.none
}
// Apply the given protection options.
sheetProtection.protect(protectionOptions);
}
Properties
allow |
Represents the worksheet protection option allowing use of the AutoFilter feature. |
allow |
Represents the worksheet protection option allowing deleting of columns. |
allow |
Represents the worksheet protection option allowing deleting of rows. |
allow |
Represents the worksheet protection option allowing editing of objects. |
allow |
Represents the worksheet protection option allowing editing of scenarios. |
allow |
Represents the worksheet protection option allowing formatting of cells. |
allow |
Represents the worksheet protection option allowing formatting of columns. |
allow |
Represents the worksheet protection option allowing formatting of rows. |
allow |
Represents the worksheet protection option allowing inserting of columns. |
allow |
Represents the worksheet protection option allowing inserting of hyperlinks. |
allow |
Represents the worksheet protection option allowing inserting of rows. |
allow |
Represents the worksheet protection option allowing use of the PivotTable feature. |
allow |
Represents the worksheet protection option allowing use of the sort feature. |
selection |
Represents the worksheet protection option of selection mode. |
Property Details
allowAutoFilter
Represents the worksheet protection option allowing use of the AutoFilter feature.
allowAutoFilter?: boolean;
Property Value
boolean
allowDeleteColumns
Represents the worksheet protection option allowing deleting of columns.
allowDeleteColumns?: boolean;
Property Value
boolean
allowDeleteRows
Represents the worksheet protection option allowing deleting of rows.
allowDeleteRows?: boolean;
Property Value
boolean
allowEditObjects
Represents the worksheet protection option allowing editing of objects.
allowEditObjects?: boolean;
Property Value
boolean
allowEditScenarios
Represents the worksheet protection option allowing editing of scenarios.
allowEditScenarios?: boolean;
Property Value
boolean
allowFormatCells
Represents the worksheet protection option allowing formatting of cells.
allowFormatCells?: boolean;
Property Value
boolean
allowFormatColumns
Represents the worksheet protection option allowing formatting of columns.
allowFormatColumns?: boolean;
Property Value
boolean
allowFormatRows
Represents the worksheet protection option allowing formatting of rows.
allowFormatRows?: boolean;
Property Value
boolean
allowInsertColumns
Represents the worksheet protection option allowing inserting of columns.
allowInsertColumns?: boolean;
Property Value
boolean
allowInsertHyperlinks
Represents the worksheet protection option allowing inserting of hyperlinks.
allowInsertHyperlinks?: boolean;
Property Value
boolean
allowInsertRows
Represents the worksheet protection option allowing inserting of rows.
allowInsertRows?: boolean;
Property Value
boolean
allowPivotTables
Represents the worksheet protection option allowing use of the PivotTable feature.
allowPivotTables?: boolean;
Property Value
boolean
allowSort
Represents the worksheet protection option allowing use of the sort feature.
allowSort?: boolean;
Property Value
boolean
selectionMode
Represents the worksheet protection option of selection mode.
selectionMode?: ProtectionSelectionMode;
Property Value
Office Scripts