Tim Moor
2005-11-28 21:16:25 UTC
dear vbs gurus
the following code reports an error -> invalid root in registrykey, if the
registry key is not existent. why does my error handling not return ->
Function False instead of the error box displayed. thanx alot
tim
snip.........................
If CheckRegKey(strMapNameKey)= True then
MsgBox " Function True "
Else
MsgBox " Function False "
End If
Function CheckRegKey(RegStr)
On Error Resume Next
WshShell.RegRead RegStr
If Err Then
CheckRegKey = False
Else
CheckRegKey = True
End If
On Error Goto 0
End Function
the following code reports an error -> invalid root in registrykey, if the
registry key is not existent. why does my error handling not return ->
Function False instead of the error box displayed. thanx alot
tim
snip.........................
If CheckRegKey(strMapNameKey)= True then
MsgBox " Function True "
Else
MsgBox " Function False "
End If
Function CheckRegKey(RegStr)
On Error Resume Next
WshShell.RegRead RegStr
If Err Then
CheckRegKey = False
Else
CheckRegKey = True
End If
On Error Goto 0
End Function