title: Iterating unregistered add-ins (.xla)
body: <p>I need help in</p>
  
  <ul>
  <li>figuring out how to iterate through currently open Excel add-in files <em>(.xla)</em> that have not been registered in Excel using the <code>Tools &gt; Add-ins</code> menu path.</li>
  <li>more specifically, I am interested in any workbook that doesn't appear in the Add-In dialog, but has <code>ThisWorkbook.IsAddin = True</code>.</li>
  </ul>
  
  <p>Demonstrating the issue:</p>
  
  <p>Trying to loop through workbooks as follows doesn't get workbooks with <code>.AddIn = True</code>:</p>
  
  <pre><code>Dim book As Excel.Workbook
  
  For Each book In Application.Workbooks
      Debug.Print book.Name
  Next book
  </code></pre>
  
  <p>Looping through add-ins doesn't get add-ins that are not registered:</p>
  
  <pre><code>Dim addin As Excel.AddIn
  
  For Each addin In Application.AddIns
      Debug.Print addin.Name
  Next addin
  </code></pre>
  
  <p>Looping through the VBProjects collection works, but only if user has specifically trusted access to the Visual Basic Project in the Macro Security settings - which is rarely:</p>
  
  <pre><code>Dim vbproj As Object
  
  For Each vbproj In Application.VBE.VBProjects
      Debug.Print vbproj.Filename
  Next vbproj
  </code></pre>
  
  <p>However, if the name of the workbook is known, the workbook can be referenced directly regardless of whether it is an add-in or not:</p>
  
  <pre><code>Dim book As Excel.Workbook
  Set book = Application.Workbooks("add-in.xla")
  </code></pre>
  
  <p>But how the heck to get reference to this workbook if the name is not known, and user's macro security settings cannot be relied on?</p>