Thread: on error coding
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Otto Moehrbach[_2_] Otto Moehrbach[_2_] is offline
external usenet poster
 
Posts: 1,071
Default on error coding

It's not a matter of before or after. It's bracketing your action code with
the On Error code. Before the code that you thing might error out, write
something like "On Error Resume Next". With this line you have said "Don't
EVER stop on ANY error". Obviously, you don't want that. You just want to
trap the possible error within a small bit of your code. After your code
has dealt with the error you want a line like "On Error GoTo 0". That
returns the error detection system back to normal. Does this help? Otto

"Matthew Dyer" wrote in message
...
Could someone please give me a brief overview of how the 'on error'
code works? what different kinds of things can I do with it? Do I
place it before code that may return an error or after?