title: Excel Add-Ins Sometimes Do Not Load
body: <p>I have a few excel add-ins that fail to load sometimes when I open an existing workbook. Here are some of the pertinent facts and things I have noticed when trying to diagnose:</p>
  
  <ul>
  <li>These are regular excel add-ins, not COM add-ins.  </li>
  <li>Add-ins always load when opening excel from the program menu.</li>
  <li>Add-ins do not load ~10-20% of the time when opening a workbook from email/shared drive/personal drive.</li>
  <li>I am unable to consistently replicate the issue.  Sometimes the opening the same workbook will load the add-ins, sometime it won't.</li>
  <li><p>The issue might be connected to one of the toolkits that has an installer built into it.  (the idea behind this add-in is that it can be sent to people, and they can install it just by opening.  Then, once it's installed in the AddIns folder, it no longer does anything when the add-in is loaded).</p>
  
  <pre><code>Private Sub Workbook_Open()
  
  If Right(ThisWorkbook.Path, 6) &lt;&gt; "AddIns" Then
  
   Dim blRegister As Boolean
   Dim ThisAddIn As AddIn
  
   Application.DisplayAlerts = False
   On Error Resume Next
  
   ThisWorkbook.Sheets("Installing").Activate
  
   Application.AddIns("Toolkit").Installed = False
  
   ThisWorkbook.SaveAs "Z:\AppData\Microsoft\AddIns\ToolKit.xlam", AccessMode:=xlExclusive, ConflictResolution:=Excel.XlSaveConflictResolution.xlLocalSessionChanges, FileFormat:=55
  
   On Error GoTo 0
  
   blRegister = Application.RegisterXLL("Z:\AppData\Microsoft\AddIns\ToolKit.xlam")
  
   Set ThisAddIn = Application.AddIns.Add("Z:\AppData\Microsoft\AddIns\ToolKit.xlam")
   ThisAddIn.Installed = True
  
   MsgBox "Thanks for Installing the Toolkit!"
   ThisWorkbook.Close False
  
   Application.DisplayAlerts = True
  
  End If
  
  End Sub
  </code></pre></li>
  </ul>
  
  <p>Any help or insight would be greatly appreciated.</p>