0

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.

ThunderFrame
  • 9,352
  • 2
  • 29
  • 60

1 Answers1

0

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
ThunderFrame
  • 9,352
  • 2
  • 29
  • 60
  • Re "...enumerate the paths of each add-in/database..." my Assess DB has two add-ins, but your code here lists only the path to my Access DB and nothing for either Add-In. – Wayne G. Dunn Dec 05 '16 at 00:00
  • Are they VBA add-ins or COM add-ins? Are they visible in VBE? – ThunderFrame Dec 05 '16 at 00:27
  • They are MDA's, which are not visible in VBE, nor are they COMAddIn's. I have Avery, which is a COMAddIn, plus two mda's. The code I listed earlier shows the COMAddIn's, but I have been unable to 'list' the MDA's. I can search the Registry and get a list from: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\14.0\Access\Menu Add-Ins\ – Wayne G. Dunn Dec 05 '16 at 00:49
  • Hmm, I thought the MDAs were loaded on-demand. The utility ACCDA only appears in the VBE *after* I've used Zoom (or some other utility feature). I wonder if your MDAs are present but not yet used/loaded? – ThunderFrame Dec 05 '16 at 00:53
  • Yes, if I invoke the add-in, then can see in VBE. Therefore your code above will show the path. – Wayne G. Dunn Dec 05 '16 at 01:25