#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default OnTime VB

I want to refresh my data every day at 12am. Does something like this
make sence?

Public RunWhen As Double

Sub StartTimer()

RunWhen = Time() = #12:00:00 AM# + TimeSerial(24, 0, 0)
Application.OnTime earliesttime:=RunWhen, procedu="The_Sub", _
schedule:=True
End Sub

Sub The_Sub()


ActiveWorkbook.RefreshAll
StartTimer

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default OnTime VB

This makes more sense

Sub StartTimer()

RunWhen = Date + 1 + TimeSerial(12, 0, 0)
Application.OnTime earliesttime:=RunWhen, procedu="The_Sub", _
schedule:=True
End Sub

--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

wrote in message
oups.com...
I want to refresh my data every day at 12am. Does something like this
make sence?

Public RunWhen As Double

Sub StartTimer()

RunWhen = Time() = #12:00:00 AM# + TimeSerial(24, 0, 0)
Application.OnTime earliesttime:=RunWhen, procedu="The_Sub", _
schedule:=True
End Sub

Sub The_Sub()


ActiveWorkbook.RefreshAll
StartTimer

End Sub



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
OnTime VB [email protected] Excel Discussion (Misc queries) 5 May 17th 06 10:53 PM
Can someone explain OnTime? hw Excel Discussion (Misc queries) 1 May 4th 05 05:04 PM
Excel 2003 / Windows XP Pulsating Excel screen !! monir Excel Discussion (Misc queries) 9 February 7th 05 11:50 PM


All times are GMT +1. The time now is 02:16 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"