How to set References Programmatically?

F

Frederick Wilson

Hello all,

Through the years that I have been reading here, I have read and used
the solution of reseting references so functions in code work. If one
were to distribute an application how can you programmatically check
that all required references are set?

I have no real need for it, just curious.

Thanks,
Fred
 
D

Douglas J. Steele

To check that there aren't any problems with your References, use code like:

Sub ReferenceProperties()
Dim ref As Reference

For Each ref In References
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
 
Top