excel-dnaadvanced-installerxll

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 ?


Solution

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