On error do yourErrorroutine with ... code line 1 code line 2 && which causes the error code line 3 Function YourErrorRoutine Lparameter ... ... some message to the user Do Case Case ... && Retry the code which causes the error (line 2) Retry Case ... && Ingore the error and go on with thenext line (line 3) Return Case ... && Stop processing Cancel && this stops all processing. look out with this. EndCase