PDA

View Full Version : [SOLVED] Msg Box restarting every 5 seconds



Dot
03-01-2017, 05:27 PM
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

Logit
03-01-2017, 05:48 PM
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.

Dot
03-01-2017, 06:13 PM
The Excel reports that:


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

Logit
03-01-2017, 06:30 PM
Place shwMsg macro into a routine module. Do not place it in ThisWorkBook.

Sorry for the confusion.

Dot
03-01-2017, 06:38 PM
Genius my Friend.
Thanks for the efficency.

Thread solved.


Thank You very much

Logit
03-01-2017, 06:56 PM
Glad to help