OnTime events

B

bambam77

I am having trouble getting an Application.OnTime event to work. I a
typing in the code correctly, but when the time comes around, nothin
happens. I am using a test example from a VBA guide book, so I know th
code is written correctly. I just don't know why nothing happens. Ca
anyone help me
 
C

Chip Pearson

It would be helpful if you posted the code you are using.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
B

bambam77

OOps Sorry

Sub SetAlarm()
Application.OnTime 0.625, "DisplayAlarm"
End Sub

Sub DisplayAlarm()
Beep
MsgBox "Wake up. It's time for break!"
End Sub
 
T

Tom Ogilvy

dir you run the subroutine SetAlarm?

You ran it and nothing happened at 3 PM.

You can test with a command like
Application.OnTime now + TimeValue("00:00:15"), "DisplayAlarm"

to have it run in 15 seconds.
 
B

bambam77

Ys, I ran the SetAlarm routine and nothing happened. i will try the code
you gave to try a test.


Thanks
 
B

bambam77

Maybe I didn't run the Macro. I thought I didn't need to assign it to
button or anything to make it work. I thought it just work
automatically let me know if I'm wrong
 
Top