Results 1 to 6 of 6

Thread: Error Handling

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 1999
    Location
    Harrington, DE USA
    Posts
    21

    Post

    I'm trying to implement error handling in my program. I don't want to have to put "On Error Goto ErrorHandler" in every sub or function. It becomes tedious! Does anyone know any other way around this?

    TIA,
    XinMan

  2. #2
    Member
    Join Date
    Jul 1999
    Location
    J-ville, NC
    Posts
    54

    Post

    I don't think there is away around that one. In order for every procedure to become error handled, you must have the On Error statment at the top of each one.

    But I may be wrong....

    ------------------
    David Underwood
    Cannabatech Corporation

    ICQ - 14028049
    E-mail - [email protected]




  3. #3
    Guest

    Post

    Try putting it in the Declarations (Dont know if it'll work ) section but according to MSDN you will need it for every procedure.

    Glenn Harwood

  4. #4
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Post

    Yes, every routine that needs error handling needs to have its own On Error Goto... statement. Have you ever just copied an existing routine and just changed it to suit your needs (leaving the On Error... of course)?

    ------------------
    Marty

  5. #5
    Junior Member
    Join Date
    Jan 2000
    Posts
    21

    Post

    I've noticed that if you have a sub/function with an error handling routine and from that sub call another sub the error handler is still active which means that the sub you called don't need any error handling.

  6. #6
    Hyperactive Member
    Join Date
    Jan 1999
    Location
    Rotterdam, Netherlands
    Posts
    386

    Post

    True, and it depends on what kind of function it is if it needs error handling....
    and yes, it would be very kewl if you could add a line in the declarations like
    On Error Goto errorhandlersub
    and that that sub gets called when an error occured.. including function name of course that got the error :-)
    but until then, the best i can come up with is write an addin which will add error handling to every sub and function..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width