Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Registry to install Excel AddIn

I created an excel Add-In called

Project Count_Per Person.xlam

When I open up excel and go to Development>AddIns and select my AddIn to install, it does not stay installed if I close out of excel even after saving. The AddIn I made, creates a new MenuBarButton under the tab 'AddIns'

So I created a new registry Key to install the addin at startup under

HKEY_CURRENT_USER\Software\Microsoft\Office\Excel\Addins\ProjectCount_PerPerson

The Key looks like this

(Default)     REG_SZ        (value not set)
Description   REG_SZ        Project Count_Per Person
FriendlyName  REG_SZ        Project Count_Per Person
LoadBehavior  DWORD         0x00000003 (3)
Manifest      REG_SZ        C:\Users\b012918\AppData\Roaming\Microsoft\AddIns\Project Count_Per Person.xlam

When I start Excel, it displays that it is installing the AddIn, but then I get an

Exception reading manifest from

file:///C:/Users/b012918/AppData/Roaming/Microsoft/AddIns/Project%Count_Per%Person.xlam:

the manifest may not be valid or file could not be opened.

http://pastebin.com/bN1datV5

Any insight into what I'm messing up would be beneficial.

Additional Information:

If the addin is uninstalled when I start excel, it gives the manifest error. If the addin is 'checked' when I start excel, it gives the download error in the comment below. Even if the addin is previously installed, the CommandBarButton does not stay in place. Also, under options--> addins the addin is stated to be "Active".

like image 721
brett s Avatar asked Sep 03 '25 17:09

brett s


1 Answers

Just to clarify, there are two types of addins for Excel (and the other Office apps), VBA addins and COM addins. A COM addin is developed via Visual Studio and the Visual Studio Tools for Office. That is what brett s is referencing to.

But the more likely type are normal VBA Excel Addins, typically distributed via a .xlam file. In order to load such an addin automatically for a user, you need the addin file on some local directory on the machine and reference it via the Registry. For Excel 2010, a REG file to load the corresponding registry key is:

Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Excel\Options]
"OPEN"="C:\\Path\\To\Addin\\Addin.xlam"

This way the addin is loaded everytime you start Excel.

like image 68
SeriousITGuy Avatar answered Sep 05 '25 07:09

SeriousITGuy