VBA to enumerate in-memory Global Objects

mdlueck

Sr. Application Developer
Local time
Today, 12:55
Joined
Jun 23, 2011
Messages
2,648
Is there a VBA way to enumerate in-memory Global Objects?

I know a sure way to reset all Global Objects is to closed the database and reopen it. So was wondering if there is a way to list the valid objects of Global Memory.

Watches is able to peek inside the Global Objects, but I need to know a valid object name in order to configure a Global watch. Thus my question above...
 
Excellent quetion, the answer could be useful.
Don't have an answer, but will be watching this discussion.
Using the F2 Object Browser in a running application - is this the list of objects desired?
[image attached]
One wonders if the Object Browser has an object model available from VBA. It appears that it does for VB and VB.NET.

Code:
' this code is claimed to work from VB - there is a class libary reference required
Private Sub ListClassesInAccess()
Dim TypeLibrary As TypeLibInfo
Dim ClassList As CoClasses
Dim i As Integer
Dim Path As String
Path = "C:\Program Files\Microsoft Office\OFFICE11\MSACC.OLB"
Set TypeLibrary = TypeLibInfoFromFile(Path)
Set ClassList = TypeLibrary.CoClasses
For i = 1 To ClassList.count
    Debug.Print ClassList.item(i).Name
    'MsgBox
Next
Set TypeLibrary = Nothing
Set ClassList = Nothing
End Sub

http://accessblog.net/2010/02/build-your-own-object-browser.html
Copied: VB6 (and perhaps earlier versions) was shipped with TLBINF32.DLL - TypeLib Information Object Library, which you can use in Access or any other VBA host.

My short break indicates that it is possible with the right type library. Has Microsoft kept up on these type libraries? Hopefully someone can submit something better than this.
 

Attachments

  • F2 Object Browser Global.gif
    F2 Object Browser Global.gif
    14 KB · Views: 107
Last edited:

Users who are viewing this thread

Back
Top Bottom