Get GUID


Home           Programming       Favorites      

The following code will print the GUID and the Major and Minor version numbers for all your references into the Immediate Window.

See AddReferences to see how the GUID and the Major and Minor version numbers are used.
Sub GetGUID()

   Dim VBAEditor As VBIDE.VBE
   Dim VBProj As VBIDE.VBProject
   Dim i As Integer
   Dim strResults As String


   Set VBAEditor = Application.VBE
   Set VBProj = VBAEditor.ActiveVBProject


   For i = 1 To VBProj.References.Count
      strResults = VBProj.References(i). _
      Name & vbTab

      strResults = strResults & VBProj. _
      References(i).GUID & vbTab

      strResults = strResults & VBProj. _
      References(i).Major & vbTab

      strResults = strResults & VBProj. _
      References(i).Minor & vbTab

      Debug.Print strResults
   Next i
End Sub