2

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!

Coffee Ocean
  • 109
  • 2
  • 4

2 Answers2

0

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.

Sudhi Ramamurthy
  • 2,358
  • 1
  • 10
  • 14
0

Try getting the cell and calling

cell.dataValidation = {
  type: 'list',
  allowBlank: true,
  formulae: ['"Selected,Rejected,On-hold"'],
};

based on How to add data validation list in excel using javascript

Mario Petrovic
  • 7,500
  • 14
  • 42
  • 62