Office JS GetActiveCell代码示例引发InvalidArgument错误

时间:2019-02-10 22:36:15

标签: excel office-js

我正在尝试Office JS API,我要做的就是获取活动单元格。我使用的示例是in their documentation。我收到以下错误:

ERROR Error: Uncaught (in promise): InvalidArgument: 
The argument is invalid or missing or has an incorrect format.

那我在做什么错了?

await Excel.run(async (context) => {

let myWorkbook = context.workbook;
let activeCell = myWorkbook.getActiveCell();
activeCell.load("address");

await context.sync();

console.log("The active cell is " + activeCell.address);
});

0 个答案:

没有答案