Function GetObjectClass(ByVal LogicalName)
GetObjectClass = ""
Dim arrTypes
arrTypes = Array("Browser", "Window", "Dialog", "JavaWindow")
On Error Resume Next
For each sType in arrTypes
Err.Clear
Set TempObj = Eval(sType & "(" & LogicalName & ")")
If Err.Number = 0 then
'Match found
GetObjectClass = sType
On Error Goto 0
Exit Function
End if
Next
On Error Goto 0
End Function