Search code examples
excelloadregistryadd-in

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".


Solution

  • I Built an Add-In called 'FirstExcelAddIn' with Visual Studio, and checked to see what it did when It built the Registry Keys. I had my registry correct from the keys shown in the question, I just did not have all the files it was looking for in a COM addin.

    Here is what my functioning addin looks like in the registry

    (Default)     REG_SZ        (value not set)
    Description   REG_SZ        FirstExcelAddIn
    FriendlyName  REG_SZ        FirstExcelAddIn
    LoadBehavior  DWORD         0x00000003 (3)
    Manifest      REG_SZ        C:\Users\b012918\AppData\Roaming\Microsoft\AddIns\FirstExcelAddIn.vsto|vstolocal
    

    Here are the files that need to be present in the folder for the addin to work properly

    1. FirstExcelAddIn.dll
    2. FirstExcelAddIn.dll.manifest
    3. FirstExcelAddIn.vsto
    4. Microsoft.Office.Tools.Common.v4.0.Utilities.dll

    I suspect that if you went through the effort to write your Add-In from scratch without tools, you would only need the '.dll' and '.dll.manifest' for your addin to work.