determine if reference library exists

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to determine if a reference library is installed on the
current computer? I can't seem to find the proper collection for this type
of query.

Thank you,

Daniel P
 
Are you asking how to determine all of the reference libraries installed on
a given machine, or whether a referenced library actually exists?

For the former, you'd have to query the registry (and it's a non-trivial
exercise)

For the latter, you can check whether any of the Reference elements in the
References collection have their IsBroken property set. From the Help file:

Sub ReferenceProperties()
Dim ref As Reference

' Enumerate through References collection.
For Each ref In References
' Check IsBroken property.
If ref.IsBroken = False Then
Debug.Print "Name: ", ref.Name
Debug.Print "FullPath: ", ref.FullPath
Debug.Print "Version: ", ref.Major & "." & ref.Minor
Else
Debug.Print "GUIDs of broken references:"
Debug.Print ref.GUID
EndIf
Next ref

End Sub

(Note that if the IsBroken property is True, Access generates an error if
you try to read the Name or FullPath properties.)
 
Back
Top