【发布时间】:2021-08-31 10:58:19
【问题描述】:
我正在使用 office.js 通过我的 office-addin 与 Excel 进行交互。微软文档说我们可以使用下面的代码保存 Excel,但它一直给我这个控制台错误
TypeError: context.workbook.save is not a function
链接到 Microsoft 文档 - https://docs.microsoft.com/en-us/javascript/api/excel/excel.workbook?view=excel-js-preview#save_saveBehavior_
await Excel.run(async (context) => {
if (Office.context.requirements.isSetSupported('ExcelAPI', '1.11')) {
context.workbook.save(Excel.SaveBehavior.save);
console.log('supported');
} else {
console.log('not supported');
}
})
我尝试了很多,但无法摆脱这个错误。我只是想知道是我做错了什么还是微软文档不正确。请帮忙。
【问题讨论】:
标签: javascript excel office-addins