in VBS, the only error handling features are represented by 2 statments and one object : Statments
Code:
On error resume next
: Start error handling
Code:
On error goto 0
: ends error handling Object
Code:
Err
object has these usefull properties and methods :
Code:
Number
: error number (Long)
Code:
Description
: error description (String)
Code:
Clear()
: Clears the err object.
Here's an example of how to use it
Code:
on error resume next
' put it your 'risky' command
if err.number <> 0 Then
Msgbox err.description,, "Error Number " & err.Number
err.clear
exit sub
end if
On error goto 0
Water is not bad as long as it stays out human body ;-)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.