Gtari Abir
Gtari Abir

Reputation: 69

Create installer For Excel DNA Add-In using Advanced Installer

i created some new user defined functions for excel using excel dna add-in and when i add the add-in manually to excel it works, now i want to create an installer to deploy automatically this add-in into excel, i downloaded Advanced installer and created a new installer project, specify a name,version and Publisher in Product Details interface,in prerequisites i selected .Net Framework 4.5(web installer), in launch conditions/Software i selected Installed Office Application/ Microsoft Excel, in the files and folders i added my class library (.dll)/my xll file and my dna file, finally i choose theme =>build and run my project but when i excecute the setup generated when i run this project and try to test my functions from excel, i don't found them, the installer i created didn't add this add-in to excel, is there some missing steps please ?

Upvotes: 1

Views: 1868

Answers (3)

Andy Sinclair
Andy Sinclair

Reputation: 2303

You need to add a custom action to register the Add-in, for example:

On Error Resume Next
Dim oXL, oAddin
Set oXL = CreateObject("Excel.Application")
oXL.Workbooks.Add
Set oAddin = oXL.AddIns.Add(Session.property("CustomActionData") & "MyAddin.xll", False)
oAddin.Installed = True
oXL.Quit
Set oXL = Nothing

This article, as mentioned in Govert's answer, explains how to setup the custom actions: https://jiripik.com/2017/02/25/use-advanced-installer-excel-dna-project/

I followed the steps in the article and have created a reliable installer for my Excel DNA based add-in, it works really well. The only issue is that you need to create 2 installers: one for 32 bit Excel and another for 64 bit Excel. Unfortunately I cannot find a reliable way of detecting which version of Excel is installed.

Hope this helps.

Upvotes: 2

Govert
Govert

Reputation: 16907

For an .xll Excel add-in (like those made with Excel-DNA) you need some registry entries that Office installer normally don't add. They're called OPEN, OPEN1, OPEN2 etc. under one of the Excel keys.

For Advanced Installer you can read a very detailed write-up here: https://jiripik.com/2017/02/25/use-advanced-installer-excel-dna-project/

Another alternative is to use the standard WiX toolkit to make your installer. For this you can start with the Excel-DNA WiXInstaller as a template project: https://github.com/Excel-DNA/WiXInstaller It has a custom actions project to make the installer for those extra registry keys.

Upvotes: 1

Bogdan Mitrache
Bogdan Mitrache

Reputation: 10993

Advanced Installer provides a wizard for Office add-ins, as you can see in the video of the linked article.

This wizard configures some registry entries, according to MSDN docs, these registry are the way Office detects your addin. If you don't have them your installer is incomplete.

You need to create the project using that wizard, after which you can further customize all the project settings you specified in your question (product details, launch conditions, etc...)

Upvotes: 0

Related Questions