I am new to Excel Add-ins and Office.js. I am trying to explore to code add-in projects.
Here i'm trying to read values from a Named Range. Firstly I'm trying to get range object and then load values for that range.
I'm not able to get those values but this code neither throws an error nor prints values to the console:
Excel.run(function (ctx) {
var range = ctx.workbook.names.getItem("MyRange").getRange();
range.load("values");
return ctx.sync(function () {
console.log("required range values -> ");
console.log(range.values);
});
}).catch(function (e) {
console.log("error info is" + e.message);
});
Here I already have MyRange in my sheet.