ExcelScript.WorksheetProtectionOptions interface

代表工作表保护中的选项。

注解

示例

/**
 * 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);
}

属性

allowAutoFilter

表示允许使用自动筛选功能的工作表保护选项。

allowDeleteColumns

表示允许删除列的工作表保护选项。

allowDeleteRows

表示允许删除行的工作表保护选项。

allowEditObjects

表示允许编辑对象的工作表保护选项。

allowEditScenarios

表示允许编辑方案的工作表保护选项。

allowFormatCells

表示允许设置单元格格式的工作表保护选项。

allowFormatColumns

表示允许设置列格式的工作表保护选项。

allowFormatRows

表示允许设置行格式的工作表保护选项。

allowInsertColumns

表示允许插入列的工作表保护选项。

allowInsertHyperlinks

表示允许插入超链接的工作表保护选项。

allowInsertRows

表示允许插入行的工作表保护选项。

allowPivotTables

表示允许使用数据透视表功能的工作表保护选项。

allowSort

表示允许使用排序功能的工作表保护选项。

selectionMode

表示选择模式的工作表保护选项。

属性详细信息

allowAutoFilter

表示允许使用自动筛选功能的工作表保护选项。

allowAutoFilter?: boolean;

属性值

boolean

allowDeleteColumns

表示允许删除列的工作表保护选项。

allowDeleteColumns?: boolean;

属性值

boolean

allowDeleteRows

表示允许删除行的工作表保护选项。

allowDeleteRows?: boolean;

属性值

boolean

allowEditObjects

表示允许编辑对象的工作表保护选项。

allowEditObjects?: boolean;

属性值

boolean

allowEditScenarios

表示允许编辑方案的工作表保护选项。

allowEditScenarios?: boolean;

属性值

boolean

allowFormatCells

表示允许设置单元格格式的工作表保护选项。

allowFormatCells?: boolean;

属性值

boolean

allowFormatColumns

表示允许设置列格式的工作表保护选项。

allowFormatColumns?: boolean;

属性值

boolean

allowFormatRows

表示允许设置行格式的工作表保护选项。

allowFormatRows?: boolean;

属性值

boolean

allowInsertColumns

表示允许插入列的工作表保护选项。

allowInsertColumns?: boolean;

属性值

boolean

表示允许插入超链接的工作表保护选项。

allowInsertHyperlinks?: boolean;

属性值

boolean

allowInsertRows

表示允许插入行的工作表保护选项。

allowInsertRows?: boolean;

属性值

boolean

allowPivotTables

表示允许使用数据透视表功能的工作表保护选项。

allowPivotTables?: boolean;

属性值

boolean

allowSort

表示允许使用排序功能的工作表保护选项。

allowSort?: boolean;

属性值

boolean

selectionMode

表示选择模式的工作表保护选项。

selectionMode?: ProtectionSelectionMode;

属性值