Consulting

Results 1 to 6 of 6

Thread: Msg Box restarting every 5 seconds

  1. #1

    Msg Box restarting every 5 seconds

    Hello Folks.
    I believe itīs a simple question.

    How to do a msgbox appear every 5 seconds?
    Following code example:

    ..........................................
    Private Sub workbook_open()
    MsgBox "hello msgbox", vbYesNo
    End Sub
    ..............................................

    I need this alert appears in the specified time.


    Thanks

  2. #2
    VBAX Expert Logit's Avatar
    Joined
    Sep 2016
    Posts
    613
    Location
    In ThisWorkbook paste this:

    Private Sub workbook_open()
         shwMsg
    End Sub


    Option Explicit
    
    
    Sub shwMsg()
         MsgBox "hello msgbox", vbYesNo
        Application.OnTime Now + TimeValue("00:00:05"), "shwMsg"
    End Sub
    Boy is your user going to be busy.

  3. #3
    The Excel reports that:


    "You cannot run the macro shwMsg! Maybe not be available or is disabled"

  4. #4
    VBAX Expert Logit's Avatar
    Joined
    Sep 2016
    Posts
    613
    Location
    Place shwMsg macro into a routine module. Do not place it in ThisWorkBook.

    Sorry for the confusion.

  5. #5
    Genius my Friend.
    Thanks for the efficency.

    Thread solved.


    Thank You very much

  6. #6
    VBAX Expert Logit's Avatar
    Joined
    Sep 2016
    Posts
    613
    Location
    Glad to help

Posting Permissions

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