NickCoe(UK)
New member
- Local time
- Today, 12:39
- Joined
- Jan 10, 2023
- Messages
- 19
This is proving rather tricky using Application.References in a loop. It lists what we can already see in Tools/References which for 365 ctr is wrong for many libs.
If anyone's got any suggestions I'll be happy to hear them
I guess my next steps are diving in to the registry and/or searching system directories for name.
Here's a paste of the last efforts results. As you can see it's just repeating what's in tools/references in the editor. It just can't report what I've heard called 'virtualised folders'
Immediate:
Name: VBA
True Location: C:\Program Files\Common Files\Microsoft Shared\VBA\VBA7.1\VBE7.DLL
GUID: {000204EF-0000-0000-C000-000000000046}
Built-in: True
----------------------
Name: Access
True Location: C:\Program Files\Microsoft Office\root\Office16\MSACC.OLB
GUID: {4AFFC9A0-5F99-101B-AF4E-00AA003F0F07}
Built-in: True
----------------------
Name: ADODB
True Location: C:\Program Files\Common Files\System\ado\msado15.dll
GUID: {B691E011-1797-432E-907A-4D8C69339129}
Built-in: False
----------------------
Name: Office
True Location: C:\Program Files\Common Files\Microsoft Shared\OFFICE16\MSO.DLL
GUID: {2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}
Built-in: False
----------------------
Name: VBIDE
True Location: C:\Program Files (x86)\Common Files\Microsoft Shared\VBA\VBA6\VBE6EXT.OLB
GUID: {0002E157-0000-0000-C000-000000000046}
Built-in: False
----------------------
Name: SHDocVw
True Location: C:\Windows\System32\ieframe.dll
GUID: {EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}
Built-in: False
----------------------
Name: DAO
True Location: C:\Program Files\Common Files\Microsoft Shared\OFFICE16\ACEDAO.DLL
GUID: {4AC9E1DA-5BAD-4AC7-86E3-24F4CDCECA28}
Built-in: False
----------------------
Name: bpac
True Location: C:\Program Files\Common Files\Brother\b-PAC\bpac.dll\1
GUID: {90359D74-B7D9-467F-B938-3883F4CAB582}
Built-in: False
----------------------
If anyone's got any suggestions I'll be happy to hear them
I guess my next steps are diving in to the registry and/or searching system directories for name.
Code:
CODE:Sub ListTrueReferenceLibraryLocations()
Dim ref As Reference
Dim refList As String
Dim truePath As String
On Error Resume Next ' Handle any errors gracefully
' Loop through all references
For Each ref In Application.References
' Attempt to resolve the true file path
truePath = ref.FullPath
If Err.Number = 0 Then
refList = refList & "Name: " & ref.Name & vbCrLf
'refList = refList & "Description: " & ref.Description & vbCrLf
refList = refList & "True Location: " & truePath & vbCrLf
refList = refList & "GUID: " & ref.Guid & vbCrLf
refList = refList & "Built-in: " & ref.BuiltIn & vbCrLf
refList = refList & "----------------------" & vbCrLf
Else
' Error occurred; possibly a missing reference
refList = refList & "Name: " & ref.Name & vbCrLf
refList = refList & "Error retrieving location (missing or invalid reference)." & vbCrLf
refList = refList & "----------------------" & vbCrLf
Err.Clear
End If
Next ref
' Output the reference list to the Immediate Window
Debug.Print refList
On Error GoTo 0 ' Restore error handling
End Sub
Here's a paste of the last efforts results. As you can see it's just repeating what's in tools/references in the editor. It just can't report what I've heard called 'virtualised folders'
Immediate:
Name: VBA
True Location: C:\Program Files\Common Files\Microsoft Shared\VBA\VBA7.1\VBE7.DLL
GUID: {000204EF-0000-0000-C000-000000000046}
Built-in: True
----------------------
Name: Access
True Location: C:\Program Files\Microsoft Office\root\Office16\MSACC.OLB
GUID: {4AFFC9A0-5F99-101B-AF4E-00AA003F0F07}
Built-in: True
----------------------
Name: ADODB
True Location: C:\Program Files\Common Files\System\ado\msado15.dll
GUID: {B691E011-1797-432E-907A-4D8C69339129}
Built-in: False
----------------------
Name: Office
True Location: C:\Program Files\Common Files\Microsoft Shared\OFFICE16\MSO.DLL
GUID: {2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}
Built-in: False
----------------------
Name: VBIDE
True Location: C:\Program Files (x86)\Common Files\Microsoft Shared\VBA\VBA6\VBE6EXT.OLB
GUID: {0002E157-0000-0000-C000-000000000046}
Built-in: False
----------------------
Name: SHDocVw
True Location: C:\Windows\System32\ieframe.dll
GUID: {EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}
Built-in: False
----------------------
Name: DAO
True Location: C:\Program Files\Common Files\Microsoft Shared\OFFICE16\ACEDAO.DLL
GUID: {4AC9E1DA-5BAD-4AC7-86E3-24F4CDCECA28}
Built-in: False
----------------------
Name: bpac
True Location: C:\Program Files\Common Files\Brother\b-PAC\bpac.dll\1
GUID: {90359D74-B7D9-467F-B938-3883F4CAB582}
Built-in: False
----------------------