RyderS2
10-21-2015, 09:33 AM
Hi all... Excel 2010...
I've researched this for hours... and for the life of me I can't see why this is broken... this is standard stuff:
I have a userform application, and I'm running a repeating OnTime routine that fires once per second. This routine is placed in a MODULE... and it does function properly...
Public AlertTime as Double 'or as date
Sub Pulse()
If PulseActive = True Then
AlertTime = Now + TimeValue("00:00:01")
Application.OnTime AlertTime, "Pulse"
'add code here to do fun stuff every second
Else
Application.OnTime AlertTime, "Pulse", , False 'cancel the OnTime
End If
End Sub
the ONLY issue is that Application.OnTime AlertTime, "Pulse", , False causes an error:
Run-time error '1004':
Method 'OnTime' of object' _Application' failed
I also tried the common variant: Application.OnTime EarliestTime:=AlertTime, Procedure:="Pulse", Schedule:=False
Same error.
What in blazes is going on???
Thanks for you kind help.
R
I've researched this for hours... and for the life of me I can't see why this is broken... this is standard stuff:
I have a userform application, and I'm running a repeating OnTime routine that fires once per second. This routine is placed in a MODULE... and it does function properly...
Public AlertTime as Double 'or as date
Sub Pulse()
If PulseActive = True Then
AlertTime = Now + TimeValue("00:00:01")
Application.OnTime AlertTime, "Pulse"
'add code here to do fun stuff every second
Else
Application.OnTime AlertTime, "Pulse", , False 'cancel the OnTime
End If
End Sub
the ONLY issue is that Application.OnTime AlertTime, "Pulse", , False causes an error:
Run-time error '1004':
Method 'OnTime' of object' _Application' failed
I also tried the common variant: Application.OnTime EarliestTime:=AlertTime, Procedure:="Pulse", Schedule:=False
Same error.
What in blazes is going on???
Thanks for you kind help.
R