I’m trying to figure out if it’s possible to execute code in my task pane without rendering the task pane. I’ve reviewed all the relevant documentation here
https://learn.microsoft.com/en-us/office/dev/add-ins/develop/loading-the-dom-and-runtime-environment
https://learn.microsoft.com/en-us/office/dev/add-ins/develop/show-hide-add-in
https://learn.microsoft.com/en-us/office/dev/add-ins/develop/run-code-on-document-open
https://learn.microsoft.com/en-us/javascript/api/office/office.startupbehavior?view=common-js-preview
Before launching the workbook in the web, I add the following to the workbook
We.WebExtensionProperty webExtensionProperty1 = new We.WebExtensionProperty() { Name = "Office.AutoShowTaskpaneWithDocument", Value = "true" };
webExtensionPropertyBag1.Append(webExtensionProperty1);
This will auto show the task pane. But in my add-in code I do the following:
Office.addin.setStartupBehavior(Office.StartupBehavior.load);
in the Office.onReady() function.
This is supposed to hide the task pane. What happens is the task pane briefly flashes and then is hidden.
What I’d like is to be able to run my task pane code, but not have the task pane flash briefly. Is this possible?
Thanks