Search code examples
ms-accessvbavbe

How can I enumerate the loaded add-ins in Access?


If I have a database open, and I've used the Zoom functionality (Shift + F2) in a table field, then Access has opened the Utility.accda add-in (as evidenced by the appearance of Utility in the VBE). Some other actions will also open ACWZTOOL.ACCDE. So, my VBE shows 3 projects...

How can I enumerate the paths of each add-in/database?

I'm trying to execute some SQL against the MSysObjects table in each database, but I don't think I can do that using the Access object model without opening a connection to each add-in path.


Solution

  • Huh, I forgot that I could access the filename from each VBProject...

    This enumerates all of the paths of any open database and add-in.

    Sub EnumPaths()
    
      Dim proj
      For Each proj In VBE.VBProjects
        Debug.Print proj.FileName
      Next proj
    
    End Sub