Load and install addin problems

Stevenn

Active Member
Joined
Feb 8, 2012
Messages
259
I try to install an AddIn. When I use the code below it copies the addin-file to "C:\Documents and Settings\admin\Application Data\Microsoft\AddIns" before it will work. Why do I have to copy it? I want to install it and keep it where I've already placed it. If i use "application.addins.add(filename, FALSE)" it installs an addin from the microsoftfolder instead of the filename I've specified.

Code:
Public Const ADDIN_PATH As String = "L:\07_Afdelinger\Kultur Fiktion\Analyser mv\Skabelon\Tilføjelsesprogram.xlam"
Public Sub Install()
    
    Dim objAddin As AddIn
    
    Set objAddin = Application.AddIns.Add(ADDIN_PATH, True)
    
    If objAddin.Installed = False Then
        objAddin.Installed = True
        
        MsgBox "Tilføjelsesprogrammet " & objAddin.FullName & " er blevet installeret.", vbOKOnly + vbInformation
    End If
End Sub
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Never had to do Add-ins before

But this is in the help file

The Add method adds an add-in to the list of available add-ins but doesn’t install the add-in. Set the Installed property of the add-in to True to install the add-in. To install an add-in that doesn’t appear in the list of available add-ins, you must first use the Add method and then set the Installed property. This can be done in a single step, as shown in the following example (note that you use the name of the add-in, not its title, with the Add method).

<CODE>AddIns.Add("generic.xll").Installed = True</CODE></PRE>
 
Upvote 0
Never had to do Add-ins before

But this is in the help file

The Add method adds an add-in to the list of available add-ins but doesn’t install the add-in. Set the Installed property of the add-in to True to install the add-in. To install an add-in that doesn’t appear in the list of available add-ins, you must first use the Add method and then set the Installed property. This can be done in a single step, as shown in the following example (note that you use the name of the add-in, not its title, with the Add method).


<CODE>AddIns.Add("generic.xll").Installed = True</CODE>
</PRE>

Hi,

Thanks for you answer.

I know how to both load/add and install the addin. The addin is added and installed without problems, but when I add the addin the addin file will be copied to the Microsoft Addin folder even though I want the file to remain in the directory I found it.

It doesn't do any harm, but I know it is possible to use an addin which is not copied to the Microsoft Addin folder, so i want to know how.
 
Upvote 0

Forum statistics

Threads
1,215,137
Messages
6,123,253
Members
449,093
Latest member
Vincent Khandagale

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top