Private Function IsNothing(varName As Object) As Boolean
Dim strName As String
On Error GoTo errHandler
strName = varName.Name
'Si llega hasta aquí es por que el objeto existe
IsNothing = False
'
Exit Function
'
errHandler:
Select Case Err.Number
Case 91 ' el objeto es nothing
IsNothing = True
Err.Clear
Case Else
MsgBox "Error Número: " & Str(Err.Number) & "." & _
"Descripción: " & Err.Description, , _
"Error."
Err.Clear
End Select
End Function