Error using OnTime Method

S

Sam

I am testing a simple OnTime procedure and receive an error 1004 upon
execution. Entire code is:
Sub SetAlarm()
Application.OnTime TimeValue("10:35:00 am"), "RunTest"
End Sub

Sub RunTest()
Range("A50").End(xlUp).Offset(1, 0).Value = Date
End Sub

Sub SetAnotherAlarm()
Application.OnTime EarliestTime:=TimeValue("10:48:00 am"),
Procedure:="RunTest", Schedule:=False
End Sub

The first OnTime procedure runs fine, but when I add the optional
"Schedule", I get an error "Method OnTime of object _Application failed. When
I select Help from the Debugger, I get a blank page. VBA help is installed.

Can anyone help?
 
J

JE McGimpsey

You can't clear (by using Schedule = False) a procedure that hasn't been
scheduled yet.


Here's the Help article:
 

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

Top