Excel JS Online Settings not persisting past session

吃可爱长大的小学妹 提交于 2019-12-05 07:22:00

问题


TL;DR: I'm having the same problem asked here: Excel JS API - SettingCollection not persisting

Basically, I have an Excel add-in that is trying to save some information to document settings and retrieve it later. The whole thing works perfectly on the native Mac client, but does not work on Excel online. No errors, and the document setting appears to be there even after refreshing the Taskpane. But once the browser tab is refreshed, the document setting is no longer retrievable.

Is this a known problem right now?


回答1:


there is a bug using the Excel-specific API. please use shared API in the meantime.

function createSetting() {
    Office.context.document.settings.set("Foo", "bar");
    Office.context.document.settings.saveAsync();
}

function readSetting() {
    console.log(Office.context.document.settings.get("Foo"));
}


来源:https://stackoverflow.com/questions/51661308/excel-js-online-settings-not-persisting-past-session

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