次の方法で共有


Excel.CellControlType enum

セル コントロールの種類を表します。

注釈

[ API セット: ExcelApi 1.18 ]

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/42-range/range-cell-control.yaml

// Add checkboxes to the table.
await Excel.run(async (context) => {
  const sheet = context.workbook.worksheets.getActiveWorksheet();

  // Get the second column in the table, without the header.
  const range = sheet.tables.getItem("FruitTable").columns.getItem("Analysis").getDataBodyRange();

  // Change the boolean values to checkboxes.
  range.control = {
    type: Excel.CellControlType.checkbox
  };
  await context.sync();
});

フィールド

checkbox = "Checkbox"

チェック ボックス コントロールを表す型。

empty = "Empty"

空のコントロールを表す型。

mixed = "Mixed"

制御結果が混在するクエリを表す型。

unknown = "Unknown"

不明なコントロールを表す型。 これは、将来のバージョンの Excel で追加されたコントロールを表します。現在のバージョンの Excel では、このコントロールを表示する方法がわかりません。