office-js - 在 Excel 2016 中找不到 Office JavaScript DialogApi
问题描述
我正在尝试在 Excel 中使用 Office JavaScript DialogApi 1.1。根据文档,它看起来应该适用于我的版本,但似乎没有安装。
需求集表明它不受支持,并且对象 Office.context.ui 在运行时未定义。
我是否遗漏了某些内容,或者我的 Excel 版本不支持此功能?
版本:
Windows 10
Microsoft Excel 2016 MSO (16.0.4849.1000) 32 位
任务窗格.js
Office.onReady(info => {
if (!Office.context.requirements.isSetSupported("DialogApi", 1.1)) {
// I end up here and Office.context.ui === undefined
console.log('DialogApi is not supported.')
}
});
任务窗格.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Contoso Task Pane Add-in</title>
<!-- Office JavaScript API -->
<script
type="text/javascript"
src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js"
></script>
</head>
<body>
</body>
</html>
清单.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="TaskPaneApp">
<Id>99999999-9999-9999-9999-999999999999</Id>
<Version>1.0.0.0</Version>
<ProviderName>Contoso</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<DisplayName DefaultValue="office-addon"/>
<Description DefaultValue="A template to get started."/>
<IconUrl DefaultValue="https://localhost:3000/assets/icon-32.png"/>
<HighResolutionIconUrl DefaultValue="https://localhost:3000/assets/icon-80.png"/>
<SupportUrl DefaultValue="https://www.contoso.com/help"/>
<AppDomains>
<AppDomain>https://localhost:3000</AppDomain>
</AppDomains>
<Hosts>
<Host Name="Workbook"/>
</Hosts>
<DefaultSettings>
<SourceLocation DefaultValue="https://localhost:3000/taskpane.html"/>
</DefaultSettings>
<Permissions>ReadWriteDocument</Permissions>
</OfficeApp>
解决方案
Microsoft 工程师认为可能发生的情况是 Office 用于在 UI 中报告其版本的 DLL 在您的计算机上已更新,但本应同时更新的其他 DLL 却没有。如果用户选择应用安全更新而不是其他更新,则可能会发生这种情况。当通过 Microsoft Update 应用 Office 更新时,所有 Office DLL 应自动一起更新。在手动应用更新的情况下,某些 Office DLL 可能不包含在更新中。您需要应用osfclient-x-none MSP 补丁并验证osf.dll
至少是 16.0.4390.1000 版本。
要单独应用更新,此页面列出了最新的 Office 2016 更新文件。查找osfclient-x-none更新。
推荐阅读
- c# - c# 在哪里可以通过反射找到基本类型(如 int)的重载运算符的 MethodInfo
- php - 预填充动态生成的表单 php
- vue.js - 我无法在我的 vuejs 应用程序中显示 fontawesome 图标
- python - 查找一个 numpy 数组中的值位于另一个 numpy 数组中的值之间的位置
- c# - 定期在 SearchServiceClient 和子 ISearchIndexClient 单例上重新加载凭据
- dataframe - Julia:通过保留附加变量的多个值折叠 DataFrame
- matlab - 在matlab中查找定义为函数句柄的多项式的根
- sql - 来自 SELECT 查询的 UPDATE 或 SET?
- android - 绑定适配器警告?用另一种方法覆盖另一种方法
- ruby-on-rails - 拍摄场景失败截图