Thread: On Time
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default On Time

In the vbe with our workbook as the active project,
Insert=Module

Place it there

To start it, in the project explorer in the vbe, select the ThisWorkbook
entry. In the dropdowns at the top, select workbook on the left and Open on
the right.
Private Sub Workbook_Open
StartTimer
' or if you want to run you code on opening
'Macro2
End Sub

--
Regards,
Tom Ogilvy

"Henry" wrote in message
...
I am using On Time routine from Chip Pearsons site as Follows:

Public RunWhen As Double
Public Const cRunIntervalSeconds = 30
Public Const cRUnWhat = "Macro2"

Sub StartTimer()
RunWhen = Now + TimeSerial(0, 0, cRunIntervalSeconds)
Application.OnTime earlisttime = RunWhen, procedu=cRUnWhat,

schedule:=True
End Sub


Sub Macro2()

My code

StartTimer

End Sub


Where do I sore the code and how do I actually start the procedure/
Thanks!