Macro for Message Box auto-disappear after fixed time

  • Hi!


    I have 2 Macros that pop up on Worksheet_Calculate event.


    Macro 1: This Macro pops Message from Rows of data: (Corresponds to Button 1 of attached sheet):


    and Macro 2: This Macro is for poping a Message Box that self destructs after 2 seconds if not acknowledged by User (Corresponds to Button 2 of attached sheet):

    Code
    Sub Test()
        Dim AckTime As Integer, InfoBox As Object
        Set InfoBox = CreateObject("WScript.Shell")
        AckTime = 2
        Select Case InfoBox.Popup("Click OK or do nothing within 2 seconds.", _
        AckTime, "This is your Message Box", 0)
        Case 1, -1
        Exit Sub
        End Select
     End Sub


    I need to have the message box created through Macro-1 NoData disaapear after 2 seconds if not acknowledged by User.
    Macro-2 is to help get started with some ideas in case a better and more elegant solution is not available.


    Sample file attached with both Macros

  • Re: Macro for Message Box auto-disappear after fixed time


    PopUp is not reliable though...

  • Re: Macro for Message Box auto-disappear after fixed time


    Hi jindon,


    Sorry the message box is not self-destructing/ does not self-disappear if not acknowledged. Also, above solution displays some extra message that is not required.


    Basically the Macro-2 message box is working properly and self disappearing if not acknowledged, but I need the message of Macro-1 displayed in message box of Macro-2


    Also, would prefer a message box that is completely clean (without exclamation marks etc. as are the code I have mentioned, since I will be using it for a lot of information). Your solution was somehow including a big exclamation mark in the message box.


    If anybody can give a better solution that does not use Macro-2 above, same will definitely be preferred.
    Thanks

  • Re: Macro for Message Box auto-disappear after fixed time


    As I said, it is not reliable.


Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!