OnTime events

  • Thread starter Thread starter bambam77
  • Start date Start date
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
 
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
 
OOps Sorry

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

Sub DisplayAlarm()
Beep
MsgBox "Wake up. It's time for break!"
End Sub
 
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.
 
Ys, I ran the SetAlarm routine and nothing happened. i will try the code
you gave to try a test.


Thanks
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top