PedroNL's avatar
PedroNL
Brass Contributor
Jun 04, 2021
Status:
Completed

Check box for Excel Online

It would be great if we could have check boxes as a feature for Excel Online.  Google Sheets has this feature but Excel Online doesn't please add it.

  • Hi! I'm excited to share some great news - the Checkbox is not only supported in Excel Online, but its API is also supported in the latest Excel Requirement Set 1.18!

    You can now add and manage the in-cell checkbox with the following APIs:

    • Excel.Range.Control
    • Excel.Range.ClearOrResetContents()
    • Excel.RangeAreas.ClearOrResetContents()

    Please check out the details here: 
    Excel Range Control
    Excel JS API 1.18

    Below is a sample code snippet that demonstrates how you can set a checkbox in cells:

    async function run() {​
      await Excel.run(async (context) => {​
        let range = context.workbook.getSelectedRange();​
        range.control = {​
          type: "Checkbox"​
        };​
        await context.sync();​
      });​
    }​

    Hope this is helpful!!