Search code examples
javascriptexceloffice-jsofficedev

How to insert dropdown or checkbox in Excel using Javascript API?


I'm following the doc (https://dev.office.com/reference/add-ins/excel/excel-add-ins-reference-overview) to build an Excel add-in. The add-in needs to populate an Excel table column with either dropdown or checkbox for the user to select actions to be done on the table row. I can't seem to find any API to insert dropdown/checkbox in Excel spreadsheet. Could someone advise how I could do that? Thanks!


Solution

  • UI controls such as text box, check box, button, etc. are not supported in Office-js. You'd instead need to accept such user inputs within your task pane or dialog box. Alternatively, you could accept inputs within Excel cells as well (though that is bit hard) and drop down values within cells can be included using data validation API (still in beta) to help with controlling input values.