Trapping errors

S

ssemtaf

Hi,
I have a sheet with some controls. If a debug situation occurs I
don't want the user to flung into vba land. A calming MsgBox with some
advice to do something or other would be less traumatic. Does anyone
have some code for this please.
 
D

Dave Peterson

Lots of times, you can just turn off error checking, do the thing that may cause
an error, then check for an error, and turn error checking back on.

On error resume next
'some code that could cause an error
if err.number <> 0 then
err.clear
msgbox "Don't Panic"
'more code???
end if
 
Top