+ Reply to Thread
Results 1 to 3 of 3

Creating an Error Message that Displays a MsgBox

  1. #1
    Registered User
    Join Date
    10-29-2012
    Location
    Miami, FL
    MS-Off Ver
    Excel 2013
    Posts
    33

    Creating an Error Message that Displays a MsgBox

    I am currently working on a project that has multiple Subs. To make life easier I created a Main procedure that 'Calls' the other Subs in order. I have a final Sub that sends me an email once the program is finished running since it can sometimes take a few hours to complete, which let's me get up from the computer.

    My problem is that if there is an error, I don't know it until several hours later when the email never came. Is there a way to add a feature that will create a message box (I can modify it to an email) for when the Main program has stopped running due to an error?

    Can this be done just with my Main Procedure and not with having to enter code into each of the other Sub Procedures?

    Here's an example of my main procedure:

    Please Login or Register  to view this content.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,758

    Re: Creating an Error Message that Displays a MsgBox

    What kind of error do you mean? Here's one approach that deals with VBA runtime errors, but that might not be what you meant. Create a new Sub called SendErrorEmail that notifies you of an error.

    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    10-29-2012
    Location
    Miami, FL
    MS-Off Ver
    Excel 2013
    Posts
    33

    Re: Creating an Error Message that Displays a MsgBox

    Yes that's exactly what I mean. I want to be notified when the program has either 1) Finished Successfully, or 2) Has stopped because it has encountered an error.

    Will this work for all errors?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Write msgbox displays to a file?
    By x65140 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-28-2014, 08:59 AM
  2. [SOLVED] Code displays error message reading "type mismatch"
    By kosherboy in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-12-2014, 09:32 AM
  3. Creating and error Message Userform
    By fredlo2010 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-25-2013, 11:20 PM
  4. [SOLVED] Creating an Error Message box if Macro does not have anything to copy
    By k06 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-02-2012, 06:15 PM
  5. Creating error message
    By czarredd in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-22-2010, 04:10 PM
  6. Error Message When Creating Chart
    By probe1957 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 05-01-2007, 12:04 PM
  7. MsgBox-it displays a YesNoCancel Box
    By Dohko in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-24-2007, 09:44 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1