【问题标题】:Office Addin Excel Not SavingOffice Addin Excel 不保存
【发布时间】: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


    【解决方案1】:

    ExcelAPI', '1.5' 开始支持保存excel,回调函数尝试结束

    return context.sync()
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-10
      • 2022-08-20
      • 1970-01-01
      • 1970-01-01
      • 2011-11-11
      相关资源
      最近更新 更多