切换到共享运行时间后无法加载Office外接程序

编程入门 行业动态 更新时间:2024-10-25 00:36:36
本文介绍了切换到共享运行时间后无法加载Office外接程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我按照Configure your Office Add-in to use a shared JavaScript runtime为Excel加载项配置共享运行时。

但是,它无法加载

这是我的manifest.xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <OfficeApp xmlns="schemas.microsoft/office/appforoffice/1.1" xmlns:xsi="www.w3/2001/XMLSchema-instance" xmlns:bt="schemas.microsoft/office/officeappbasictypes/1.0" xmlns:ov="schemas.microsoft/office/taskpaneappversionoverrides" xsi:type="TaskPaneApp"> <Id>f9459a58-57de-4427-9db6-b90ef7a6eb6c</Id> <Version>1.0.0.0</Version> <ProviderName>Contoso</ProviderName> <DefaultLocale>en-US</DefaultLocale> <DisplayName DefaultValue="Meekou.ExcelAddIn"/> <Description DefaultValue="Write your own Excel functions in TypeScript."/> <IconUrl DefaultValue="localhost:3000/assets/icon-32.png"/> <HighResolutionIconUrl DefaultValue="localhost:3000/assets/icon-64.png"/> <SupportUrl DefaultValue="www.contoso/help"/> <AppDomains> <AppDomain>www.contoso</AppDomain> </AppDomains> <Hosts> <Host Name="Workbook"/> </Hosts> <Requirements> <Sets DefaultMinVersion="1.1"> <Set Name="SharedRuntime" MinVersion="1.1"/> </Sets> </Requirements> <DefaultSettings> <SourceLocation DefaultValue="localhost:3000/taskpane.html"/> </DefaultSettings> <Permissions>ReadWriteDocument</Permissions> <VersionOverrides xmlns="schemas.microsoft/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0"> <Hosts> <Host xsi:type="Workbook"> <Runtimes> <Runtime resid="Taskpane.Url" lifetime="long" /> </Runtimes> <AllFormFactors> <ExtensionPoint xsi:type="CustomFunctions"> <Script> <SourceLocation resid="Functions.Script.Url"/> </Script> <Page> <SourceLocation resid="Taskpane.Url"/> </Page> <Metadata> <SourceLocation resid="Functions.Metadata.Url"/> </Metadata> <Namespace resid="Functions.Namespace"/> </ExtensionPoint> </AllFormFactors> <DesktopFormFactor> <GetStarted> <Title resid="GetStarted.Title"/> <Description resid="GetStarted.Description"/> <LearnMoreUrl resid="GetStarted.LearnMoreUrl"/> </GetStarted> <FunctionFile resid="Taskpane.Url"/> <ExtensionPoint xsi:type="PrimaryCommandSurface"> <OfficeTab id="TabHome"> <Group id="CommandsGroup"> <Label resid="CommandsGroup.Label"/> <Icon> <bt:Image size="16" resid="Icon.16x16"/> <bt:Image size="32" resid="Icon.32x32"/> <bt:Image size="80" resid="Icon.80x80"/> </Icon> <Control xsi:type="Button" id="TaskpaneButton"> <Label resid="TaskpaneButton.Label"/> <Supertip> <Title resid="TaskpaneButton.Label"/> <Description resid="TaskpaneButton.Tooltip"/> </Supertip> <Icon> <bt:Image size="16" resid="Icon.16x16"/> <bt:Image size="32" resid="Icon.32x32"/> <bt:Image size="80" resid="Icon.80x80"/> </Icon> <Action xsi:type="ExecuteFunction"> <FunctionName>action</FunctionName> </Action> </Control> </Group> </OfficeTab> </ExtensionPoint> </DesktopFormFactor> </Host> </Hosts> <Resources> <bt:Images> <bt:Image id="Icon.16x16" DefaultValue="localhost:3000/assets/icon-16.png"/> <bt:Image id="Icon.32x32" DefaultValue="localhost:3000/assets/icon-32.png"/> <bt:Image id="Icon.80x80" DefaultValue="localhost:3000/assets/icon-80.png"/> </bt:Images> <bt:Urls> <bt:Url id="Functions.Script.Url" DefaultValue="localhost:3000/dist/functions.js"/> <bt:Url id="Functions.Metadata.Url" DefaultValue="localhost:3000/dist/functions.json"/> <bt:Url id="Functions.Page.Url" DefaultValue="localhost:3000/dist/functions.html"/> <bt:Url id="GetStarted.LearnMoreUrl" DefaultValue="go.microsoft/fwlink/?LinkId=276812"/> <bt:Url id="Commands.Url" DefaultValue="localhost:3000/commands.html"/> <bt:Url id="Taskpane.Url" DefaultValue="localhost:3000/taskpane.html"/> </bt:Urls> <bt:ShortStrings> <bt:String id="Functions.Namespace" DefaultValue="Meekou"/> <bt:String id="GetStarted.Title" DefaultValue="Get started with your sample add-in!"/> <bt:String id="CommandsGroup.Label" DefaultValue="Commands Group"/> <bt:String id="TaskpaneButton.Label" DefaultValue="Show Taskpane"/> </bt:ShortStrings> <bt:LongStrings> <bt:String id="GetStarted.Description" DefaultValue="Your sample add-in loaded succesfully. Go to the HOME tab and click the 'Show Taskpane' button to get started."/> <bt:String id="TaskpaneButton.Tooltip" DefaultValue="Click to Show a Taskpane"/> </bt:LongStrings> </Resources> </VersionOverrides> </OfficeApp>

以下是错误

Compiled with problems:X Error: [tsl] ERROR in C:UsersedwardMeekouMeekouMeekou.ExcelAddInsrc askpane askpane.ts(37,34) TS2304: Cannot find name 'add'. Error: [tsl] ERROR in C:UsersedwardMeekouMeekouMeekou.ExcelAddInsrc askpane askpane.ts(38,34) TS2552: Cannot find name 'logMessage'. Did you mean 'onmessage'? Error: [tsl] ERROR in C:UsersedwardMeekouMeekouMeekou.ExcelAddInsrccommandscommands.ts(38,34) TS2304: Cannot find name 'add'. Error: [tsl] ERROR in C:UsersedwardMeekouMeekouMeekou.ExcelAddInsrccommandscommands.ts(39,34) TS2552: Cannot find name 'logMessage'. Did you mean 'onmessage'? 推荐答案

我无法再现您的问题。您的清单看起来没问题。

在我看来,错误消息应该与";CustomFunctionsMetadataPlugin";相关(它将在npm run build期间调用)。

在将";.ts";编译为";.js";之前,插件";CustomFunctionsMetadataPlugin";会将";Associate";逻辑(CustomFunctions.associate("ADD", add))添加到输入文件(例如srcfunctionsfunctions.ts)。

从错误消息中,我猜测&CustomFunctionsMetadataPlugin&可能在您这边错误地执行了上述步骤。您可以尝试add "associate" logic manually查看问题是否已解决。

您还可以共享编译后的文件(distfunction.js),以便我可以帮助进行进一步检查。

谢谢,

润东

更多推荐

切换到共享运行时间后无法加载Office外接程序

本文发布于:2023-11-11 23:41:57,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1579870.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:外接   切换到   加载   时间   程序

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!