-1

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...

Sri vahgar
  • 109
  • 1
  • 8

1 Answers1

0

The Excel Data Validation APIs are part of the ExcelApi 1.8 Requirement Set. This Requirement Set is not supported on non-subscription Office 2016. It is supported on subscription Office (Office 365) Version 1808 (Build 10730.20102) or later. For more information about the Excel Requirement Sets, see Excel JavaScript API Requirement Sets.

Rick Kirkham
  • 9,038
  • 1
  • 14
  • 32