Add excel custom functions to an existing excel add-in - Javascript Api

筅森魡賤 提交于 2019-12-04 20:40:50
David Chesnut

In your manifest file, you need to separate the custom function portion out of the DesktopFormFactor section into its own AllFormFactors section. So it should look like

...
   <DesktopFormFactor>
     <ExtensionPoint xsi:type="PrimaryCommandSurface">
...
     </ExtensionPoint>
   </DesktopFormFactor>

   <AllFormFactors>
     <ExtensionPoint xsi:type="CustomFunctions">
...
     </ExtensionPoint>
   </AllFormFactors>
...

I recently uploaded a sample that has custom functions and a task pane here if this helps for reference.

My response is too complicated for a comment, so I'll use an "answer" and later revise it or delete it as needed.

First a small terminology point: If you have one manifest, then you have one add-in. Your references to "two add-ins" is confusing the situation. Both a task pane and a set of custom functions can be deployed in the same add-in.

As I understand it, you have been able to successfully deploy custom functions in an add-in that does not include a task pane. To merge this into your task pane add-in, the html and JavaScript files that you used for the custom functions should be distinct files from the HTML and JavaScript files in your task pane add-in project. You should not try to have the same HTML file serve both as a page in the task pane and as the loader for the custom functions JavaScript.

I think what you need to do is essentially this: copy the html, javascript, and json files from the custom functions add-in to the exact same folder location in the task pane add-in project. Then copy the Extension point part of the manifest of the custom function add-in, and the resids that it declares, into the appropriate locations in the manifest for the task pane add-in.

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