Application.OnTime

Thedda

Registered User.
Local time
Yesterday, 22:11
Joined
Aug 2, 2002
Messages
16
I'm trying to run this code in Excel 2003, but am having problems with it.

Sub DoItAll()
Application.OnTime TimeValue("00:00:05"), "Refresh_Chart"
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 5
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
Call Refresh_Chart
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 5
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
Application.OnTime TimeValue("00:00:15"), "Refresh_Todd"
Call Refresh_Todd

It doesn't like newHour, newMinute, newSecond. I have ran this code before in Excel 2000 with no problems. I'm using Excel 2003 now and am not sure if this is the problem. Appricate any help you can give me.:confused:
 

Users who are viewing this thread

Back
Top Bottom