+ Reply to Thread
Results 1 to 9 of 9

Automatic resuming after Message Box ?

  1. #1
    Forum Contributor
    Join Date
    08-04-2005
    Location
    Madrid, Spain
    MS-Off Ver
    2010
    Posts
    241

    Automatic resuming after Message Box ?

    Once a MsgBox has popped up,
    is there some code that will make it disappear after a pause of, say, 3 seconds (and execution of the macro resume and proceed),
    without the user having to press ENTER or ESC?

    I searched the Forum and found suggestions like this one:
    Code:
    Application.Wait (Now + TimeValue("0:00:3"))but they don’t seem to work after MsgBox:

    Much obliged for any help
    ACA
    Last edited by aca; 07-28-2011 at 09:30 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Automatic resuming after Message Box ?

    Quote Originally Posted by aca View Post
    Once a MsgBox has popped up, is there some code that will make it disappear after a pause of, say, 3 seconds ....
    EDIT: I am sorely wrong on this one....as Andy has pointed to some very useful examples!
    Last edited by JBeaucaire; 07-17-2011 at 05:26 AM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Automatic resuming after Message Box ?

    If it's your message box then maybe
    http://www.excelforum.com/excel-prog...ssage-box.html
    Cheers
    Andy
    www.andypope.info

  4. #4
    Forum Contributor
    Join Date
    08-04-2005
    Location
    Madrid, Spain
    MS-Off Ver
    2010
    Posts
    241

    Re: Automatic resuming after Message Box ?

    Thank you, JBocaire, for that reminder.
    However, because of Andy Pope's hopeful suggestion (I thank you also, Andy), I can add that
    yes: the Message Box is of my own making (to notify that the data in the worksheet just opened hasn't been updated).
    So, any possibilities, Andy?
    aca
    Last edited by aca; 07-17-2011 at 05:00 AM.

  5. #5
    Valued Forum Contributor mohd9876's Avatar
    Join Date
    05-04-2011
    Location
    Amman, Jordan
    MS-Off Ver
    Excel 2010
    Posts
    426

    Re: Automatic resuming after Message Box ?

    you can use the Popup method from the Wscript.Shell library and specify a period of time after which the box will be hidden
    Please Login or Register  to view this content.
    see this

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Automatic resuming after Message Box ?

    Did you check the link I posted?

  7. #7
    Forum Contributor
    Join Date
    08-04-2005
    Location
    Madrid, Spain
    MS-Off Ver
    2010
    Posts
    241

    Re: Automatic resuming after Message Box ?

    Query solved.

    Gosh, mhd, you're knowledgeable!
    That's the answer; it works perfectly. Many thanks.

    And sorry, Andy, I hadn't noticed your link. That also works all right.

    I added to your reputation; both.
    ACA

  8. #8
    Forum Contributor
    Join Date
    08-04-2005
    Location
    Madrid, Spain
    MS-Off Ver
    2010
    Posts
    241

    Re: Automatic resuming after Message Box ?

    Besides Mohd's and Andy's solutions above, I've subsequently thought of another way around this problem:
    Instead of a MesgBox I can use a UserForm with only a TextBox in it.
    A UserForm does disappear after a pause (provided its ‘ShowModal’ property is set to ‘False’);
    so, for instance, with this code for 2 seconds:
    Please Login or Register  to view this content.
    Besides, the TextBox in the form lets me use the colors and font sizes I want.
    ACA
    Last edited by aca; 07-28-2011 at 04:09 AM.

  9. #9
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Automatic resuming after Message Box ?

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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