Question : Help with OnTime Event

I'm new to VBA and am following VBA Programming for Dummies book.  I'm trying to create an alarm popup using the attached code, but it is not working.  Nothing is happening.  Is there something I'm missing?
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
Sub SetAlarm()
Application.OnTime TimeValue("12:39:00 pm"), "DisplayAlarm"
End Sub

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

Answer : Help with OnTime Event

Hello BBlu,

The code is fine.  Is it in a normal code module and have you run the SetAlarm sub to trigger it?

Note as there is no reset of the call this is a one time operation - i.e. once triggered it needs SetAlarm running again.

Regards,

chris_bottomley
Random Solutions  
 
programming4us programming4us