Reputation: 5540
I am following this link to try custom functions. The following manifest does enable the custom functions:
<?xml version="1.0" encoding="utf-8"?>
<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>a124c024-2ae8-4d1a-bb00-7ff68c6fb738</Id>
<!-- Generate a new guid for your Id element -->
<Version>1.0.0.0</Version>
<ProviderName>Contoso</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<DisplayName DefaultValue="Custom functions sample" />
<Description DefaultValue="A variety of sample custom functions." />
<Hosts>
<Host Name="Workbook" />
</Hosts>
<DefaultSettings>
<SourceLocation DefaultValue="https://www.myweb.com/customfunctions.html"/>
</DefaultSettings>
<Permissions>ReadWriteDocument</Permissions>
<VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
<Hosts>
<Host xsi:type="Workbook">
<AllFormFactors>
<ExtensionPoint xsi:type="CustomFunctions">
<Script>
<SourceLocation resid="functionsjs" />
</Script>
<Page>
<SourceLocation resid="functionshtml"/>
</Page>
</ExtensionPoint>
</AllFormFactors>
</Host>
</Hosts>
<Resources>
<bt:Urls>
<bt:Url id="functionsjs" DefaultValue="https://www.myweb.com/customfunctions.js" />
<bt:Url id="functionshtml" DefaultValue="https://www.myweb.com/customfunctions.html" />
</bt:Urls>
</Resources>
</VersionOverrides>
</OfficeApp>
Now, I'm wondering if it is possible to have custom functions and a task pane at the same time. So I added <body>this is the body</body>
in https://www.myweb.com/customfunctions.html
. However, reloading the add-in does not make the task pane appear.
Could anyone tell me if it is possible to have custom functions and a task pane at the same time? what should I amend to enable this?
Edit 1: Changing xsi:type="VersionOverridesV1_0"
to xsi:type="TaskPaneApp"
does open the task pane, but when we try the custom functions, an error `We can't start this add-in because it isn't set up properly" is raised.
So I am still looking for a proper solution.
Upvotes: 2
Views: 350
Reputation: 2668
Yes, you can have custom functions and a task pane at the same time in the same add-in, by using add-in commands.
To enable a task pane command, use the ShowTaskpane
action in your manifest (see the help topic, like in this sample manifest on GitHub).
If you'd also like your task pane to be "permanent" whenever it's inserted, then use this topic page on automatically opening task panes.
-Michael (PM for custom functions)
Upvotes: 1