Handle loading state of Excel AddIn or preload AddIn on insert - excel

I'm developing an Excel AddIn and faced one issue.
1st issue: When user inserts the AddIn to the Excel (web) - user needs
to click any ribbon command to start loading plugin files.
2nd issue:
When plugin already inserted, the files are being downloaded.
However, if user click any command before files downloaded, nothing
happens.
I can disable all commands and enable them when source code downloaded. BUT this not works when user inserts AddIn for the first time. He MUST click any command to start downloading source code.
Question: is there any solution to force load Excel AddIn source on initial insertion?
P.S.
Startup behavior works only for the next opening of AddIn. If manifest has something similar - would be nice to know.
Env: Excel (on the web), OfficeJS API, Shared runtime, windows (if it's matter)
P.P.S. The problem - user clicks on enabled button to open taskpane, but nothing happens (the downloading just started).

Related

Startup behavior doesn't work in Excel Desktop

I have an OfficeJS Excel Addin which is used in Online Excel and Desktop Excel. I use feature
Office.addin.setStartupBehavior(Office.StartupBehavior.load);
And it work fine for Online Excel: every time I start the excel - the plugin loads in background and ready to use.
However, in Excel Desktop it doesn't work. If I "alert" current behavior (after click on command to run the addin), it says "Load", but anyway it expects user interaction before to start loading the addin.
Any thoughts on this?
Prerequisites: SharedRuntime, Windows 10, Angular based addin
link to doc: https://learn.microsoft.com/en-us/office/dev/add-ins/develop/run-code-on-document-open
You can configure your Office Add-in to load and run code as soon as the document is opened. This is useful if you need to register event handlers, pre-load data for the task pane, synchronize UI, or perform other tasks before the add-in is visible. When your add-in is configured to load on document open, it will run immediately. The Office.initialize event handler will be called. Place your startup code in the Office.initialize or Office.onReady event handler. Read more about that in the Run code in your Office Add-in when the document opens article.

How to automatically show task pane for non-function add-in when opening worksheet?

How can we tell Excel (Web and Desktop) to load but not show an add-in automatically when a workbook is opened? We want code in the add-in to check the worksheet and, if our add-in has been used on it, open the add-in task pane automatically (though we'll give the user an opt-out of the behavior).
(The add-in is just a task pane, not custom functions.)
If you haven't already done that, I would recommed taking a look at the options for running code in your Office add-in when the document opens. From that page:
Configure your add-in to load when the document opens
The following code configures your add-in to load and start running when the document is opened.
Office.addin.setStartupBehavior(Office.StartupBehavior.load);
...
Place startup code in Office.initialize
When your add-in is configured to load on document open, it will run immediately. The Office.initialize event handler will be called. Place your startup code in the Office.initialize or Office.onReady event handler.

Excel COM add is not loading during startup and have to add it manually

Excel COM addin is not loading during starting up and each time I have to add it manually. After checking the File > OPtions > Add-ins > Manage -> COM addins, I see that the 'add in' is in 'Unloaded' state. Not sure how to make it automatically load at startup.
Here's what fixed the issue for me.
Steps:
Start > type 'regedit'
Navigate to HKEY_CURRENT_USER\Software\Microsoft\Office\Excel\Addins
Then change the value of loadBehaviour to 3 for HyperionComAddin. As shown below. Just to clarify, this is the add-in that was not loading during start up for me. Picture in the question is to give an example.
Close registry and reopen it to make sure that value has not changed.
Now restart excel.
Tried and Tested on MS Excel 365 Version 1908 (Build 11929.20838 Click-to-Run)
I too had faced this issue after my organization updated my MS Office suite.
I created a custom ribbon for my addin and that was activating on excel startup.
So, I added my Addins folder to trusted paths:
Options-->Trust Center-->Trust Center Settings
Under the Trusted Locations, Just add the folder path where the addin is located.
Hope this works for your version of Excel application.
This also works for Microsoft Dynamics Excel Add In (VSTO). Upon doing above and change loading behaviour 0 to 3, closing Reg Edit, re open EXCEL, the Dynamics Add In is up, showing Dynamics TAB
It's also worth adding that the add-in has to be a trusted document or be located in a trust

Updating sideloaded add-in with Excel for iPad

Does anyone have experience updating existing Task Pane add-in, and know the correct procedure to replace / update existing add-in, to ensure latest version is loaded when re-inserted into a workbook?
I am currently in process of developing and testing aTask Pane add-in for Excel for iPad. I am able to successfully sideload the initial .xml manifest file through iTunes and add the app to a workbook via the Insert->Add-in menu. When I make changes to add-in backend HTML/ JS code however, and attempt to update to later version by deleting and re-sideloading the manifest file via iTunes, more often than not, the previous version Task Pane add-in keeps getting displayed.
Occasionally the update works and reloads correctly when inserted into a workbook, however mostly, it doesn't and the previous version HTML is retained and displayed in the Task Pane.
I have tried deleting previous manifest file via iTunes, closing add-in from workbook, closing and restarting Excel before re-sideloading, inserting add-in to new workbook, even clearing cache in Safari browser via iOS settings, and rebooting iPad, however cannot determine any consistent or reproducible procedure.
It appears that the add-in is being cached by Excel, however, cannot find any direct way to clear the cache to force the workbook to reload the updated HTML file referenced in the .xml manifest file.
Appreciate any guidance on cause and correct procedure to update existing add-in with Excel for iPad.
The easiest way of making sure that you have the latest version is versioning. If you have something like
<script src="xyz.com/abc.js">
Every time you load the app, even if the js is new, it might pick up from the cache. Instead try doing something like
<script src="xyz.com/abc.js?v=1.2">
Which now is seen as a different reference. Ideally automate the versioning on your js / css so you bypass the sticky cache when you update your add-in

VSTO Excell Add-in InstallURL - where is it stored when I publish?

I have been digging into this for quite sometime to no avail. Thanks for any pointers.
Lets say you have a simple VSTO excel add-in. In the publish properties, I have specified a publish location and an installation location for end users.
I click publish. Out comes a setup.exe, addin.vsto manifest and application files. I understand that I will eventually copy this to an install location specified in the properties.
The question is - where exactly the "installation folder url" end up?
I searched in the vsto manifest, resources in setup.exe and resources in the addin.dll etc.
Why I want to know is that at build time, I want to change the installation folder url. I tried passing a command line argument, but it seems that eventually when I publish a revision, the updates are not getting picked up on the end user machines. Now I am curious as to how this value that I enter in this dialog box is used by the publish process and where it ends up.
Thank you for reading and your time.
Answering my own question since I spent more than a week on this and it might be useful to others.
At least for the scope of the question - You are developing an excel VSTO addin
The installation folder URL that you specify in the publish properties of Visual Studio is not used. It might be used for document level customization, but not for application level add-ins.
Essentially when users install the add-in from an "installation folder url", the
value of that is entered into the registry under Office\excel\addins, and this how the add-in checks for updates.
I wish the installtion folder url is grayed out for add-ins so it is clear that it is not really used. But now you know

Resources