Excel

List all Checked GUIDS

Ease of Use

Easy

Version tested with

2000, 2002 

Submitted by:

Justinlabenne

Description:

List all the GUIDS, names, paths, etc... for all the library references checked. 

Discussion:

If you ever want a list of all the library references that are checked in your workbook, this code will list the descriptions, name, guid, major, minor, and path of the reference. NOTE: it clears info on the activesheet, it does not add a new sheet with the info. All references were set in Excel version 2000 

Code:

instructions for use

			

Option Explicit '========================== 'Original Code by Joe Was '========================== Sub ListAllCheckedRefs() Dim oLibRefs As Object Dim wkb As Workbook Dim wks As Worksheet Dim i As Long Set wkb = ThisWorkbook Set wks = wkb.ActiveSheet On Error GoTo NoAccess With wks .Range("A1").Value = "References from Excel version " & _ Application.Version & " for " & ThisWorkbook.Name .Range("A2:F2").Value = _ Array("Description", "Name", "GUID", "Major", "Minor", "Path") i = 1 For Each oLibRefs In wkb.VBProject.References i = i + 1 .Cells(1 + i, 1).Value = oLibRefs.Description .Cells(1 + i, 2).Value = oLibRefs.Name .Cells(1 + i, 3).Value = oLibRefs.GUID .Cells(1 + i, 4).Value = oLibRefs.Major .Cells(1 + i, 5).Value = oLibRefs.Minor .Cells(1 + i, 6).Value = oLibRefs.FullPath Next oLibRefs .Columns("A:F").EntireColumn.AutoFit .Range("A1:F2").Font.Bold = True .Range("A1").Select End With Set wkb = Nothing Set wks = Nothing Exit Sub NoAccess: Select Case Err.Number Case 1004 Cells.Clear MsgBox "You will need to set the " & _ "{ TRUST ACCESS TO VISUAL BASIC PROJECT } setting" & vbNewLine & _ "When the dialog appears, go to the Trusted Sources tab, " & _ "check the setting, click OK, and rerun this code again", 64 SendKeys "%T", True SendKeys "M", True SendKeys "S", True Case Else Cells.Clear MsgBox Err.Description End Select End Sub

How to use:

  1. Open an Excel Workbook
  2. Copy the code
  3. Press Alt + F11 to open the Visual Basic Editor (VBE)
  4. Select INSERT > MODULE from the menubar
  5. Paste code into the right pane
  6. Press Alt+Q to return to Excel
  7. Save workbook before any other changes
 

Test the code:

  1. Go to TOOLS > MACRO > MACROS
  2. When the dialog appears, select [ListAllCheckedRefs]
  3. Press Run
 

Sample File:

GetGuids.zip 11.74KB 

Approved by mdmackillop


This entry has been viewed 530 times.

Please read our Legal Information and Privacy Policy
Copyright @2004 - 2020 VBA Express