[lnkForumImage]
TotalShareware - Download Free Software
Usa Forum
 Home | Login | Register | Search 


 

Anonymous

12/18/2004 12:48:00 PM


Frank graphouilla:
>"La Derniere Heure", mais alors la toute derniere hein !
>Vous avez 59 minutes, 59 secondes et 999 millisecondes pour lire et
>après c'est BOUM!!
>Pire que le Watchtower , je vous l'dis.

SuperdeBOUM!

5 Answers

Joel

8/5/2009 3:12:00 AM

0

I'm not usre what line you are getting this problem. I suspect that you are
trying to clear the event before you have set the event. You may need to use
another cell to check if the timer has been set or not set. Maybe an OnError
statement

Sub worksheet_change(ByVal target As Range)

For Each cell In target
If Not Application.Intersect(cell, Range("O2")) Is Nothing Then

On Error Resume Next
'cancell old on time event
Application.OnTime _
EarliestTime:=0, _
procedure:="Assign", _
schedule:=False
On Error GoTo 0
If Err.Number <> 0 Then
Application.OnTime _
EarliestTime:=TimeValue(target.Value), _
procedure:="Assign", _
schedule:=True
End If
End If
Next cell

End Sub





"Kash" wrote:

> I am getting below error
>
> Method 'OnTime' of object'_Application' failed

Kash

8/6/2009 6:47:00 AM

0

I'm not able to get any output from the above code.. :(

Joel

8/6/2009 10:05:00 AM

0

I added message boxes to the code below to help you debug the problem.

Sub worksheet_change(ByVal target As Range)

For Each cell In target
If Not Application.Intersect(cell, Range("O2")) Is Nothing Then

On Error Resume Next
msgbox("Cancel old on timer event")
Application.OnTime _
EarliestTime:=0, _
procedure:="Assign", _
schedule:=False
On Error GoTo 0
If Err.Number <> 0 Then
msgbox("Setting New Timer")
Application.OnTime _
EarliestTime:=TimeValue(target.Value), _
procedure:="Assign", _
schedule:=True
else
msgbox("Error while clearing old event")
End If
End If
Next cell

End Sub



"Kash" wrote:

> I'm not able to get any output from the above code.. :(

Kash

8/25/2009 1:31:00 AM

0

I'm able to get both the msg

msgbox("Cancel old on timer event") & msgbox("Setting New Timer") but still
macro is not getting triggered.

JP Ronse

8/25/2009 4:15:00 PM

0

Hi Kash,

Did you activate the ontime event? Best is to put the application.ontime
statement in an event procedure of the workbook or worksheet.

Sub ontime()
Application.ontime EarliestTime:=Range("A10"), Procedure:="Test"
End Sub

Sub test()
MsgBox Prompt:="hello"
End Sub

Wkr,

JP

"Kash" <Kash@discussions.microsoft.com> wrote in message
news:D2AE4319-0A5C-491F-AD63-E8A978C22ACB@microsoft.com...
> I'm able to get both the msg
>
> msgbox("Cancel old on timer event") & msgbox("Setting New Timer") but
> still
> macro is not getting triggered.