I am creating an Excel Add-in for my project, where a list of data has to be binded to a cell as a dropdown. When i tried to use the existing code for binding it , it reverts back with the RichApi.Error
I had created Excel Addin Project with Visual studio 2017. In Home.Js file, Using document.ready function() for binding the list of values in a cell.
$(document).ready(function () {
Excel.run(function (ctx) {
var sheet = ctx.workbook.worksheets.getActiveWorksheet();
let range = sheet.getRange("A2:C2");
range.dataValidation.clear();
range.dataValidation.rule = {
list: {
inCellDropDown: true,
source: "Option1, Option2, Option3"
}
};
return ctx.sync();
});
}
)};
Expected Behavior :- Binding dropdown list to a cell
Current Behavior :- GeneralException: An internal error has occurred. at Anonymous function
Environment :
Host [Excel, Word, PowerPoint, etc.] : Excel 2016 Office version number : office Professional Plus 2016 16.0.4849 - 64 bit Operating System : Windows 10 Office Js version : Microsoft.Office.js.1.1.0.16
Kindly help on this folks...