Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sub StartTimer()
Dim RunWhen As Double RunWhen = Time() = #12:00:00 AM# + TimeSerial(24, 0, 0) Application.OnTime earliesttime:=RunWhen, procedu="The_Sub", _ schedule:=True End Sub HTH -- AP a écrit dans le message de news: ... 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 |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
This looks funny to me:
RunWhen = Time() = #12:00:00 AM# + TimeSerial(24, 0, 0) Maybe: RunWhen = date + TimeSerial(23, 59, 59) or RunWhen = date + 1 Chip Pearson has lots of instructions at: http://www.cpearson.com/excel/ontime.htm wrote: 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 -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
now with something like RunWhen = date + TimeSerial(23, 59, 59)
would that automatically refresh every day- or would it just do that one day? |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
It would only do it once.
But you could have your code set up the next time right after that time finishes. Chip shows you how at that link. wrote: now with something like RunWhen = date + TimeSerial(23, 59, 59) would that automatically refresh every day- or would it just do that one day? -- Dave Peterson |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
It would run only once. See www.cpearson.com/excel/ontime.htm
-- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com wrote in message ups.com... now with something like RunWhen = date + TimeSerial(23, 59, 59) would that automatically refresh every day- or would it just do that one day? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can someone explain OnTime? | Excel Discussion (Misc queries) | |||
Excel 2003 / Windows XP Pulsating Excel screen !! | Excel Discussion (Misc queries) |