Excel JS联机设置未在会话之前持续存在 [英] Excel JS Online Settings not persisting past session

查看:55
本文介绍了Excel JS联机设置未在会话之前持续存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

TL; DR:我在这里也遇到了同样的问题: Excel JS API -SettingCollection不持久

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

基本上,我有一个Excel加载项,它试图将一些信息保存到文档设置中并在以后检索.整个过程在本机Mac客户端上可以完美运行,但在Excel Online上无法运行.没有错误,甚至在刷新任务窗格后,文档设置似乎仍然存在.但是,一旦刷新了浏览器选项卡,就无法再获取文档设置.

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?

推荐答案

使用特定于Excel的API时存在错误.请同时使用共享的API.

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"));
}

这篇关于Excel JS联机设置未在会话之前持续存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆