Excel 无法加载基本自定义函数加载项

Ada*_*one 5 excel office365 office-js custom-functions-excel

一、环境:

\n\n

Excel 版本 1905(内部版本 11629.20246 即点即用)\n已连接到 Office 365 专业增强版

\n\n

Windows 10 企业版 10.0.16299 内部版本 16299

\n\n

我一直在尝试在 Excel 中使用自定义函数 API,但它始终无法加载我的清单。我正在使用 Visual Studio 进行开发,及其处理侧面加载。

\n\n

加载项似乎已部分加载,因为任务窗格确实打开并加载,但我的自定义功能均未注册。

\n\n

我还从https://github.com/OfficeDev/Excel-Custom-Functions-JS运行了示例项目,但无法加载并出现类似错误。

\n\n

我的管理员授予我访问加载项商店的权限,认为这可能是问题的一部分,但这没有帮助。

\n\n

我相信有一些 GPO 或设置禁用了自定义函数 API,但我不打算找到有关此类设置的任何文档。我已尽一切努力确认我提供的清单有效,但 Excel 仍声称其无效。

\n\n

Web项目的基本结构如下:

\n\n
C:.\n\xe2\x94\x82   Home.html\n\xe2\x94\x82   packages.config\n\xe2\x94\x82   WaveyWeb.csproj\n\xe2\x94\x82   WaveyWeb.csproj.user\n\xe2\x94\x82   Web.config\n\xe2\x94\x82   Web.Debug.config\n\xe2\x94\x82   Web.Release.config\n\xe2\x94\x82\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80dist\n\xe2\x94\x82       functions.html\n\xe2\x94\x82       functions.js\n\xe2\x94\x82       functions.json\n\xe2\x94\x82\n\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80Properties\n        AssemblyInfo.cs\n
Run Code Online (Sandbox Code Playgroud)\n\n

我已确认网络服务器正在预期位置提供页面。

\n\n

这是我正在尝试加载的清单。Visual Studio 不会抱怨它无效,它会检查架构。如果我做出任何无效的更改,它确实会抱怨。

\n\n

请注意,~remoteAppUrl在构建时已正确转换

\n\n
C:.\n\xe2\x94\x82   Home.html\n\xe2\x94\x82   packages.config\n\xe2\x94\x82   WaveyWeb.csproj\n\xe2\x94\x82   WaveyWeb.csproj.user\n\xe2\x94\x82   Web.config\n\xe2\x94\x82   Web.Debug.config\n\xe2\x94\x82   Web.Release.config\n\xe2\x94\x82\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80dist\n\xe2\x94\x82       functions.html\n\xe2\x94\x82       functions.js\n\xe2\x94\x82       functions.json\n\xe2\x94\x82\n\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80Properties\n        AssemblyInfo.cs\n
Run Code Online (Sandbox Code Playgroud)\n\n

查看我的 WEF 日志:

\n\n
9/18/2019 9:33:42   Medium  Web Add-In Runtime Logging Session Started          \n9/18/2019 9:33:42   Monitorable Manifest    Skipped unrecognized XML element for add-in ID : 515f3886-1c17-41be-8393-26b5acfd676a, Location : Element Namespace "http://schemas.microsoft.com/office/taskpaneappversionoverrides" : Element Name "Script", Line=52, CharPosition=14     \n9/18/2019 9:33:42   Monitorable Manifest    Skipped unrecognized XML element for add-in ID : 515f3886-1c17-41be-8393-26b5acfd676a, Location : Element Namespace "http://schemas.microsoft.com/office/taskpaneappversionoverrides" : Element Name "Page", Line=55, CharPosition=14       \n9/18/2019 9:33:42   Monitorable Manifest    Skipped unrecognized XML element for add-in ID : 515f3886-1c17-41be-8393-26b5acfd676a, Location : Element Namespace "http://schemas.microsoft.com/office/taskpaneappversionoverrides" : Element Name "Metadata", Line=58, CharPosition=14       \n9/18/2019 9:33:42   Monitorable Manifest    Skipped unrecognized XML element for add-in ID : 515f3886-1c17-41be-8393-26b5acfd676a, Location : Element Namespace "http://schemas.microsoft.com/office/taskpaneappversionoverrides" : Element Name "Namespace", Line=61, CharPosition=14      \n9/18/2019 9:33:42   Monitorable Manifest    Extension point list has no supported extension points for this client      \n9/18/2019 9:33:42   Monitorable Manifest    Issue encountered while parsing manifest, add-in ID : 515f3886-1c17-41be-8393-26b5acfd676a, Location : Error at element "VersionOverrides" : Manifest override with unsupported requirements or no supported extension points ignored: http://schemas.microsoft.com/office/taskpaneappversionoverrides, VersionOverridesV1_0, Line=78, CharPosition=5       \n9/18/2019 9:33:42   Monitorable Manifest    Skipped unrecognized XML element for add-in ID : 515f3886-1c17-41be-8393-26b5acfd676a, Location : Element Namespace "http://schemas.microsoft.com/office/taskpaneappversionoverrides" : Element Name "Script", Line=52, CharPosition=14     \n9/18/2019 9:33:42   Monitorable Manifest    Skipped unrecognized XML element for add-in ID : 515f3886-1c17-41be-8393-26b5acfd676a, Location : Element Namespace "http://schemas.microsoft.com/office/taskpaneappversionoverrides" : Element Name "Page", Line=55, CharPosition=14       \n9/18/2019 9:33:42   Monitorable Manifest    Skipped unrecognized XML element for add-in ID : 515f3886-1c17-41be-8393-26b5acfd676a, Location : Element Namespace "http://schemas.microsoft.com/office/taskpaneappversionoverrides" : Element Name "Metadata", Line=58, CharPosition=14       \n9/18/2019 9:33:42   Monitorable Manifest    Skipped unrecognized XML element for add-in ID : 515f3886-1c17-41be-8393-26b5acfd676a, Location : Element Namespace "http://schemas.microsoft.com/office/taskpaneappversionoverrides" : Element Name "Namespace", Line=61, CharPosition=14      \n9/18/2019 9:33:42   Monitorable Manifest    Extension point list has no supported extension points for this client      \n9/18/2019 9:33:42   Monitorable Manifest    Issue encountered while parsing manifest, add-in ID : 515f3886-1c17-41be-8393-26b5acfd676a, Location : Error at element "VersionOverrides" : Manifest override with unsupported requirements or no supported extension points ignored: http://schemas.microsoft.com/office/taskpaneappversionoverrides, VersionOverridesV1_0, Line=78, CharPosition=5       \n9/18/2019 9:34:43   Unexpected  Manifest    Access to the manifest XML file is denied. Contact an administrator of this add-in for help.        \n9/18/2019 9:34:43   Unexpected  Catalog Access to your add-ins trusted catalog has been denied. Select Insert > My Add-ins > Excel Options > Trust Center > Trust Center Settings > Trusted Add-in Catalogs to check your trusted catalogs.     \n9/18/2019 9:34:43   Unexpected  Manifest    Access to the manifest XML file is denied. Contact an administrator of this add-in for help.        \n9/18/2019 9:34:47   Unexpected  Manifest    Access to the manifest XML file is denied. Contact an administrator of this add-in for help.        \n9/18/2019 9:34:47   Unexpected  Catalog Access to your add-ins trusted catalog has been denied. Select Insert > My Add-ins > Excel Options > Trust Center > Trust Center Settings > Trusted Add-in Catalogs to check your trusted catalogs.     \n
Run Code Online (Sandbox Code Playgroud)\n\n

我认为我的问题是在加载实际脚本之前发生的,但为了完整起见,这里是文件的内容/dist/

\n\n

函数.html

\n\n
<?xml version="1.0" encoding="UTF-8"?>\n<!--Created:ce44715c-8c4e-446b-879c-ea9ebe0f09c8-->\n<OfficeApp \n          xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" \n          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" \n          xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" \n          xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides"\n          xsi:type="TaskPaneApp">\n\n  <Id>515f3886-1c17-41be-8393-26b5acfd676a</Id>\n\n  <Version>1.0.0.0</Version>\n  <ProviderName>Adam</ProviderName>\n  <DefaultLocale>en-US</DefaultLocale>\n\n  <DisplayName DefaultValue="Project Wavey" />\n  <Description DefaultValue="Its like excel, but with more waves"/>\n\n  <IconUrl DefaultValue="~remoteAppUrl/Images/Button32x32.png" />\n\n  <SupportUrl DefaultValue="http://www.contoso.com" />\n  <!-- Domains that will be allowed when navigating. For example, if you use ShowTaskpane and then have an href link, navigation will only be allowed if the domain is on this list. -->\n  <AppDomains>\n    <AppDomain>AppDomain1</AppDomain>\n  </AppDomains>\n  <!--End Basic Settings. -->\n\n  <!--Begin TaskPane Mode integration. This section is used if there are no VersionOverrides or if the Office client version does not support add-in commands. -->\n  <Hosts>\n    <Host Name="Workbook" />\n  </Hosts>\n\n  <Requirements>\n    <Sets DefaultMinVersion="1.1">\n      <Set Name="CustomFunctionsRuntime" MinVersion="1.1"/>\n    </Sets>\n  </Requirements>\n\n  <DefaultSettings>\n    <SourceLocation DefaultValue="~remoteAppUrl/Home.html" />\n  </DefaultSettings>\n  <!-- End TaskPane Mode integration.  -->\n\n  <Permissions>ReadWriteDocument</Permissions>\n\n  <!-- Begin Add-in Commands Mode integration. -->\n  <VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">\n    <Hosts>\n      <Host xsi:type="Workbook">\n        <AllFormFactors>\n          <ExtensionPoint xsi:type="CustomFunctions">\n            <Script>\n              <SourceLocation resid="CustomFunc.URL.JS"/>\n            </Script>\n            <Page>\n              <SourceLocation resid="CustomFunc.URL.HTML"/>\n            </Page>\n            <Metadata>\n              <SourceLocation resid="CustomFunc.URL.JSON"/>\n            </Metadata>\n            <Namespace resid="CustomFunc.Namespace"/>\n          </ExtensionPoint>\n        </AllFormFactors>\n      </Host>\n    </Hosts>\n\n    <!-- You can use resources across hosts and form factors. -->\n    <Resources>\n      <bt:Urls>\n        <bt:Url id="CustomFunc.URL.JS" DefaultValue="~remoteAppUrl/dist/functions.js"/>\n        <bt:Url id="CustomFunc.URL.HTML" DefaultValue="~remoteAppUrl/dist/functions.html"/>\n        <bt:Url id="CustomFunc.URL.JSON" DefaultValue="~remoteAppUrl/dist/functions.json"/>\n      </bt:Urls>\n      <bt:ShortStrings>\n        <bt:String id="CustomFunc.Namespace" DefaultValue="WAVE" />\n      </bt:ShortStrings>\n    </Resources>\n  </VersionOverrides>\n  <!-- End Add-in Commands Mode integration. -->\n</OfficeApp>\n
Run Code Online (Sandbox Code Playgroud)\n\n

函数.js

\n\n
9/18/2019 9:33:42   Medium  Web Add-In Runtime Logging Session Started          \n9/18/2019 9:33:42   Monitorable Manifest    Skipped unrecognized XML element for add-in ID : 515f3886-1c17-41be-8393-26b5acfd676a, Location : Element Namespace "http://schemas.microsoft.com/office/taskpaneappversionoverrides" : Element Name "Script", Line=52, CharPosition=14     \n9/18/2019 9:33:42   Monitorable Manifest    Skipped unrecognized XML element for add-in ID : 515f3886-1c17-41be-8393-26b5acfd676a, Location : Element Namespace "http://schemas.microsoft.com/office/taskpaneappversionoverrides" : Element Name "Page", Line=55, CharPosition=14       \n9/18/2019 9:33:42   Monitorable Manifest    Skipped unrecognized XML element for add-in ID : 515f3886-1c17-41be-8393-26b5acfd676a, Location : Element Namespace "http://schemas.microsoft.com/office/taskpaneappversionoverrides" : Element Name "Metadata", Line=58, CharPosition=14       \n9/18/2019 9:33:42   Monitorable Manifest    Skipped unrecognized XML element for add-in ID : 515f3886-1c17-41be-8393-26b5acfd676a, Location : Element Namespace "http://schemas.microsoft.com/office/taskpaneappversionoverrides" : Element Name "Namespace", Line=61, CharPosition=14      \n9/18/2019 9:33:42   Monitorable Manifest    Extension point list has no supported extension points for this client      \n9/18/2019 9:33:42   Monitorable Manifest    Issue encountered while parsing manifest, add-in ID : 515f3886-1c17-41be-8393-26b5acfd676a, Location : Error at element "VersionOverrides" : Manifest override with unsupported requirements or no supported extension points ignored: http://schemas.microsoft.com/office/taskpaneappversionoverrides, VersionOverridesV1_0, Line=78, CharPosition=5       \n9/18/2019 9:33:42   Monitorable Manifest    Skipped unrecognized XML element for add-in ID : 515f3886-1c17-41be-8393-26b5acfd676a, Location : Element Namespace "http://schemas.microsoft.com/office/taskpaneappversionoverrides" : Element Name "Script", Line=52, CharPosition=14     \n9/18/2019 9:33:42   Monitorable Manifest    Skipped unrecognized XML element for add-in ID : 515f3886-1c17-41be-8393-26b5acfd676a, Location : Element Namespace "http://schemas.microsoft.com/office/taskpaneappversionoverrides" : Element Name "Page", Line=55, CharPosition=14       \n9/18/2019 9:33:42   Monitorable Manifest    Skipped unrecognized XML element for add-in ID : 515f3886-1c17-41be-8393-26b5acfd676a, Location : Element Namespace "http://schemas.microsoft.com/office/taskpaneappversionoverrides" : Element Name "Metadata", Line=58, CharPosition=14       \n9/18/2019 9:33:42   Monitorable Manifest    Skipped unrecognized XML element for add-in ID : 515f3886-1c17-41be-8393-26b5acfd676a, Location : Element Namespace "http://schemas.microsoft.com/office/taskpaneappversionoverrides" : Element Name "Namespace", Line=61, CharPosition=14      \n9/18/2019 9:33:42   Monitorable Manifest    Extension point list has no supported extension points for this client      \n9/18/2019 9:33:42   Monitorable Manifest    Issue encountered while parsing manifest, add-in ID : 515f3886-1c17-41be-8393-26b5acfd676a, Location : Error at element "VersionOverrides" : Manifest override with unsupported requirements or no supported extension points ignored: http://schemas.microsoft.com/office/taskpaneappversionoverrides, VersionOverridesV1_0, Line=78, CharPosition=5       \n9/18/2019 9:34:43   Unexpected  Manifest    Access to the manifest XML file is denied. Contact an administrator of this add-in for help.        \n9/18/2019 9:34:43   Unexpected  Catalog Access to your add-ins trusted catalog has been denied. Select Insert > My Add-ins > Excel Options > Trust Center > Trust Center Settings > Trusted Add-in Catalogs to check your trusted catalogs.     \n9/18/2019 9:34:43   Unexpected  Manifest    Access to the manifest XML file is denied. Contact an administrator of this add-in for help.        \n9/18/2019 9:34:47   Unexpected  Manifest    Access to the manifest XML file is denied. Contact an administrator of this add-in for help.        \n9/18/2019 9:34:47   Unexpected  Catalog Access to your add-ins trusted catalog has been denied. Select Insert > My Add-ins > Excel Options > Trust Center > Trust Center Settings > Trusted Add-in Catalogs to check your trusted catalogs.     \n
Run Code Online (Sandbox Code Playgroud)\n\n

函数.json

\n\n
{\n  "functions": [\n    {\n      "id": "ADD",\n      "name": "ADD",\n      "description": "Add two numbers",\n      "helpUrl": "http://www.contoso.com/help",\n      "result": {\n        "type": "number",\n        "dimensionality": "scalar"\n      },\n      "parameters": [\n        {\n          "name": "first",\n          "description": "first number to add",\n          "type": "number",\n          "dimensionality": "scalar"\n        },\n        {\n          "name": "second",\n          "description": "second number to add",\n          "type": "number",\n          "dimensionality": "scalar"\n        }\n      ]\n    }\n  ]\n}\n
Run Code Online (Sandbox Code Playgroud)\n\n

运行https://github.com/OfficeDev/Excel-Custom-Functions中的 Excel 自定义函数示例项目时更新日志

\n\n
9/19/2019 13:22:06  Medium  Web Add-In Runtime Logging Session Started          \n9/19/2019 13:22:06  Monitorable Manifest    Skipped unrecognized XML element for add-in ID : ca968be6-628b-4f14-ba3c-3e614effa9bd, Location : Element Namespace "http://schemas.microsoft.com/office/taskpaneappversionoverrides" : Element Name "Script", Line=35, CharPosition=14     \n9/19/2019 13:22:06  Monitorable Manifest    Skipped unrecognized XML element for add-in ID : ca968be6-628b-4f14-ba3c-3e614effa9bd, Location : Element Namespace "http://schemas.microsoft.com/office/taskpaneappversionoverrides" : Element Name "Page", Line=38, CharPosition=14       \n9/19/2019 13:22:06  Monitorable Manifest    Skipped unrecognized XML element for add-in ID : ca968be6-628b-4f14-ba3c-3e614effa9bd, Location : Element Namespace "http://schemas.microsoft.com/office/taskpaneappversionoverrides" : Element Name "Metadata", Line=41, CharPosition=14       \n9/19/2019 13:22:06  Monitorable Manifest    Skipped unrecognized XML element for add-in ID : ca968be6-628b-4f14-ba3c-3e614effa9bd, Location : Element Namespace "http://schemas.microsoft.com/office/taskpaneappversionoverrides" : Element Name "Namespace", Line=44, CharPosition=14      \n9/19/2019 13:22:06  Monitorable Manifest    Skipped unrecognized XML element for add-in ID : ca968be6-628b-4f14-ba3c-3e614effa9bd, Location : Element Namespace "http://schemas.microsoft.com/office/taskpaneappversionoverrides" : Element Name "Script", Line=35, CharPosition=14     \n9/19/2019 13:22:06  Monitorable Manifest    Skipped unrecognized XML element for add-in ID : ca968be6-628b-4f14-ba3c-3e614effa9bd, Location : Element Namespace "http://schemas.microsoft.com/office/taskpaneappversionoverrides" : Element Name "Page", Line=38, CharPosition=14       \n9/19/2019 13:22:06  Monitorable Manifest    Skipped unrecognized XML element for add-in ID : ca968be6-628b-4f14-ba3c-3e614effa9bd, Location : Element Namespace "http://schemas.microsoft.com/office/taskpaneappversionoverrides" : Element Name "Metadata", Line=41, CharPosition=14       \n9/19/2019 13:22:06  Monitorable Manifest    Skipped unrecognized XML element for add-in ID : ca968be6-628b-4f14-ba3c-3e614effa9bd, Location : Element Namespace "http://schemas.microsoft.com/office/taskpaneappversionoverrides" : Element Name "Namespace", Line=44, CharPosition=14      \n\n
Run Code Online (Sandbox Code Playgroud)\n

小智 -1

我在日志中看到以下错误:

\n\n

9/18/2019 9:34:43 意外清单 访问清单 XML 文件被拒绝。请联系此加载项的管理员以获取帮助。
\n9/18/2019 9:34:43 意外的目录 对您的加载项信任目录的访问已被拒绝。选择“插入”>“我的加载项”>“Excel 选项”>“信任中心”>“信任中心设置”>“受信任的加载项目录”来检查您的受信任目录。

\n\n

您可能需要按照以下步骤共享该文件夹:\n1. 打开 Excel-> 打开新工作簿 -> 文件 -> 选项 ->\xc2\xa0 信任中心 -> 信任中心设置 -> 受信任的加载项目录 -> 添加包含清单文件的文件夹的网络路径。然后按确定并选中右侧框\n2. 关闭Excel并再次打开,

\n\n

希望它有帮助。

\n