Article ID: 186720
Article Last Modified on 1/23/2007
The IsBroken property returns a Boolean value indicating whether a Reference object points to a valid reference in the Windows Registry.Although this statement is correct, to receive this Boolean value you must trap for errors that are generated by the broken reference. Also, the IsBroken property becomes True only when the file being referenced is deleted and the Microsoft Windows Recycle Bin is emptied. This article details the steps necessary to receive the Boolean value.
Runtime Error 48: Error in Loading DLL
Public Function IsBrokenProperty()
Dim ref As Reference
' Enumerate through References collection.
For Each ref In References
' Check IsBroken property.
On Error GoTo errorhandler:
If ref.IsBroken = True Then
' Print the name of the reference and the fact that it is
' broken.
Debug.Print ref.Name & " is broken"
End If
Next ref
Exit Function
errorhandler:
' If the error received is 48 it's an error from the broken
' reference. Print the reference the fact it's broken and path to
' the Debug window.
If Err.Number = 48 Then
Debug.Print "Reference broken for: " & ref.FullPath
End If
End Function
?IsBrokenProperty ()Note that in the Debug Window you receive one of the following messages, depending on your operating system:
Reference broken for: C:\WINDOWS\SYSTEM\SNAPVIEW.OCX
-or-
Reference broken for: C:\WINNT\System32\SNAPVIEW.OCX
Additional query words: loop references
Keywords: kbprb kbprogramming KB186720