Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
Excel.CellControl type
- Package:
- excel
Represents an interactable control inside of a cell.
export type CellControl = UnknownCellControl | EmptyCellControl | MixedCellControl | CheckboxCellControl;
Remarks
Used by
Learn more about the types in this type alias through the following links.
Excel.UnknownCellControl, Excel.EmptyCellControl, Excel.MixedCellControl, Excel.CheckboxCellControl
Examples
// 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();
});
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Office Add-ins
Feedback
Was this page helpful?
