Thread: OnTime Problem
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
J.E. McGimpsey J.E. McGimpsey is offline
external usenet poster
 
Posts: 493
Default OnTime Problem

Can't tell from that code.

If you're using the rest of Chip's code as he demonstrates, it
shouldn't give you the error, so I'd go back an look at his examples.

Re-opening the workbook sounds like you may be calling OnTime more
than once before the first time to fire, so that StopTimer is only
catching one of the multiple calls. Or perhaps your code isn't
properly updating RunWhen.

The error when you remove the On Error statement would seem to
indicate that RunWhen or cRunWhat was not being set correctly, or
that StopTimer was being called more than once (so that the first
time killed the RunWhen event, and the second one threw the error,
since there was no longer a scheduled event at that time).

Pure speculation without seeing your other code, though...

In article ,
"Peter Pantus" wrote:

Please any help,

Im using XP and Excel 2000
When I run StopTimer() and I close the workbook, the workbook opens itself.
I cannot stop the timer. I've usted the right time to stop the timer.

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, _
procedu=cRunWhat, schedule:=False
End Sub