title: Programmatically Install Add-In VBA
body: <p>I'm looking to create a macro that'll install an add-in for the user to the excel ribbon. I'm upto:</p>
  
  <pre><code>Private Sub Workbook_Open()
  
  On Error Resume Next
  Application.AddIns("Name of Addin").Installed = False
  On Error GoTo 0
  
  With Application
      .AddIns.Add "Filepath to addin in shared location", False
      .AddIns("Name of Addin").Installed = True
  End With
  
  ThisWorkbook.Close False
  
  End Sub
  </code></pre>
  
  <p>Once running the macro, the addin installs to the ribbon no problems. The issue is, once excel is closed down, the addin no longer shows in the ribbon.</p>
  
  <p>It would appear that excel is expecting the addin to be copied into the users C:\Documents and Settings\Username\Application Data\Microsoft\AddiIns folder as it throws the error that it can't find it when starting excel after closing down.</p>
  
  <p>Now my understanding is that the second (false) variable for the line of code below basically says that the addin shouldn't be copied to the AddIns directory and rather should stay in the shared location.</p>
  
  <pre><code>.AddIns.Add "Filepath to addin in shared location", False
  </code></pre>
  
  <p>Any ideas on why Excel is expecting the addin to be in the users default folder?</p>