0

I have an excel add in having a task pane, some custom functions and dialogs. It is using shared runtime and shared runtime URL is of same page which I open in task pane.

I have some settings and based on these settings, I enable/disable some buttons on ribbon toolbox. I am doing in this document ready event of shared runtime/task pane URL. When I call some custom function or open a dialog these controls in ribbon are correctly enabled/disabled, However if I open task pane I am getting error "RichApi.Error: The Sharedruntime ID is missing.". My guess is that shared runtime is not loaded yet. Is there a way to load shared runtime or some event when I am sure that shared run time is loaded in task pane.


<Runtimes>
    <Runtime resid="SharedRuntime.Url" lifetime="long" />
</Runtimes>

<DefaultSettings>
    <SourceLocation DefaultValue="~remoteAppUrl/Src/Login/login.html" />
</DefaultSettings>


<bt:Url id="SharedRuntime.Url" DefaultValue="~remoteAppUrl/Src/Login/login.html" />
Kashif
  • 85
  • 8
  • Please add to your question the `` and all the `` elements from your manifest. – Rick Kirkham Jul 20 '22 at 21:52
  • 1
    I open all my taskpanes via `customfunctions` AKA my manifest only has `executefunction` and then I have functions to open specific task panes. Might be a workaround for you. I suspect this will be hard to help w/ for other without seeing your entire project. Also, the formatting of your posted code makes my eyes hurt :( – FreeSoftwareServers Jul 22 '22 at 20:16
  • @FreeSoftwareServers, after following your suggestion, I am not getting this error anymore, however when I open taskpane using code Office.addin.showAsTaskpane(); it does not load my taskpane page, I have to manually use option of Reload. – Kashif Aug 04 '22 at 17:08
  • 1
    I personally use JQuery to load custom HTML into a div on a taskpane. This way I only have on `index.html` and then my actual taskpanes are just sections of HTML that gets loaded in the `div`. Generally each taskpane as 1x JS file that is specific to that taskpane that gets loaded. – FreeSoftwareServers Aug 04 '22 at 19:01

0 Answers0