OnTime problem

P

Peter Pantus

Please any help,

Im using XP and Excel 2000
When I run StopTimer() and I close the workbook, the workbook opens itself.
When I delete the On Error Resume Next line I get a error message "Methode
OnTime van object_Application is mislukt"
Can anyone tell me what I'm doing wrong??

Sub StopTimer()
On Error Resume Next
Application.OnTime earliesttime:=RunWhen, _
procedure:=cRunWhat, schedule:=False
End Sub
 
T

Tom Ogilvy

Sub Macro7()
runwhen = Now
cRunWhat = "macro2"
Application.OnTime Earliesttime:=runwhen, _
Procedure:=cRunWhat, schedule:=True
Application.OnTime Earliesttime:=runwhen, _
Procedure:=cRunWhat, schedule:=False
End Sub

runs fine. This would indicate that your runwhen value does not represent a
time when a macro is scheduled to run. This must match exactly.
 

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


Top