JavaScript API for Office getRange method

无人久伴 提交于 2019-12-11 04:45:26

问题


Is there a way to get a range by row, column, numRows, numColumns?

For example:

Excel.run(function (ctx) {
    var sheet = ctx.workbook.worksheets.getActiveWorksheet();
    var range = sheet.getRange(1, 2, 3, 4).load("values");
    ...
});

回答1:


In the next release of ExcelAPI 1.7 we will have worksheet.getRangeByIndexes which is exactly what you are looking for.

In the meantime you can achieve the same by doing the following:

var range = sheet.getCell(1,2).getResizedRange(3,4);

-Philip, Software Engineer on the Office Extensibility team



来源:https://stackoverflow.com/questions/43848153/javascript-api-for-office-getrange-method

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!