Thread: error trapping
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_3_] Jim Thomlinson[_3_] is offline
external usenet poster
 
Posts: 983
Default error trapping

Nope. Every procedure and function must have error handling. You need to
modify every one to look something like this.

sub test
on error goto errorhandler:
'your code here
exit sub
ErrorHandler:
call module1.SaveAndClose
end sub

On the up side this if just a bunch of cutting and pasting, so it should not
take too long to do.

HTH


" wrote:

Hi,

I have a program with lots of different modules. Can i create another
module that tells the program to save and close with a message to the
user if any of the other modules fail. I have heard of error trapping
but i believe you have to assign this to every module, i would like to
try and avoid this if posible

regards

John