Thread: error 1004
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
pls123 pls123 is offline
external usenet poster
 
Posts: 121
Default error 1004


Hi all again !!!
i got this error opening my page..

=============
run time error 1004
method 'ontime' of object '_application' failed
=============

on this line ...
Application.OnTime nTime, "RunTimer", , False



.....if i dont set "error resume next"
....how can avoid it ??
This is all the macro.. tx for help !!






Option Explicit

Public nTime As Double

================================================== =

Public Sub StartTimer()

Dim aWB As Workbook
Dim aWS As Worksheet
Set aWB = ThisWorkbook
Set aWS = aWB.Worksheets("Sheet1")

On Error Resume Next
Application.OnTime nTime, "RunTimer", , False '<<<<<<<<<<<<<<
'On Error GoTo 0

aWS.Range("O8").Value = 0
aWS.Range("G10").Calculate

RunTimer
End Sub