-1

In looking through the documentation here: https://dev.office.com/reference/add-ins/excel/range, I can't find a method to simply activate a cell/range. Is this simple method not supported in Office Web API?

Hari
  • 373
  • 3
  • 11

1 Answers1

1

You can active a cell by use the select() method of Range. Here is an example for your reference:

Excel.run(function (ctx) {
    var sheetName = "Sheet1";
    var rangeAddress = "F5:F10"; 
    var range = ctx.workbook.worksheets.getItem(sheetName).getRange(rangeAddress);
    range.select();
    return ctx.sync(); 
    });
}).catch(function(error) {
        console.log("Error: " + error);
        if (error instanceof OfficeExtension.Error) {
            console.log("Debug info: " + JSON.stringify(error.debugInfo));
        }
});
Fei Xue
  • 14,369
  • 1
  • 19
  • 27