在现有 Excel 加载项中使用 OfficeRuntime.storage 时出现问题

Problem with using OfficeRuntime.storage in existing Excel Add-in

我正在尝试在我现有的 Excel 加载项任务窗格和新添加的自定义函数之间共享一些数据。当我尝试 set/get 值时,出现 "NotImplemented: Not implemented." 错误。

我在我的任务窗格页面中引用了这个包:

<script src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js"></script>

而且我在我的任务窗格中使用存储是这样的:

OfficeRuntime.storage.setItem('someData', someData)
    .then((result) =>
    {
      console.log(result);
    }, (error) =>
    {
      console.log('Store error: ');
      console.log(error);
    });

我也在我的加载项中使用 Typescript,所以我添加了

"@types/office-runtime": "^1.0.7"

类型包。 我在一些示例中看到 OfficeRuntime.AsyncStorage 使用了,但我不能使用它,因为它在 IntelliSense 中不可用。

我还想补充一点,我有 Excel 版本 1904(内部版本 11601.20204)和 Windows 10 版本 10.0.17763 内部版本 17763

抱歉耽搁了。我相信我们已经解决了这个问题。你能再试一次吗?

如果它仍然重现,请告诉我们!

https://github.com/OfficeDev/office-js/issues/522