Results 1 to 3 of 3

Thread: [RESOLVED] [Excel VBA] Error handling

  1. #1

    Thread Starter
    Member
    Join Date
    May 2011
    Posts
    42

    Resolved [RESOLVED] [Excel VBA] Error handling

    I have a "Main" macro and in it I have On Error GoTo ErrorHandler, and at the end of the sub I have ErrorHandler: with what I want to go there.

    What happens if I call another macro, "Secondary", inside of "Main", and an error occurs inside "Secondary"? Does the error handling in "Main" work? Or, do I need to put it inside "Secondary" as well?

    Or, is it possible to put it outside of any sub, so that it works for all subs in a specific module? I only have one module in the workbook.

    Thanks

  2. #2
    Hyperactive Member
    Join Date
    Oct 2010
    Location
    Indiana
    Posts
    457

    Re: [Excel VBA] Error handling

    Try looking at this, there is a basic and an advanced error handling sections;

    http://msdn.microsoft.com/en-us/libr...dErrorHandling

  3. #3

    Thread Starter
    Member
    Join Date
    May 2011
    Posts
    42

    Re: [Excel VBA] Error handling

    I guess the answer to my question is no. It doesn't work in the secondary procedure, unless you put it in there also. And, you can't put it outside the procedures, at the top of a module, to make it work for all of them, or so it seems. There is a way to do this sort of thing, but it's way too complicated for what I'm working on.

Tags for this Thread

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