![]() |
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 |
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 |
All times are GMT +1. The time now is 12:02 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com