Application.OnTime Machine Operation Limits?

SBF12345

Well-known Member
Joined
Jul 26, 2014
Messages
614
Greetings,

I have a number of scraper like subs that I would like to automate. for this task I am using a number of subs to serve as the timing tool like the one below:
Code:
Sub YZ_ST19()

    RW19 = Now + TimeSerial(744, 0, 0)
    Application.OnTime EarliestTime:=RW19, Procedure:=RWCALL19, _
        Schedule:=True


End Sub
My question is whether or not I can turn my computer off and get the updates at the moment that I turn it back on? or would I need to have my machine running 24/7 to allow for the code to maintain the time counter. Any ideas?
 

Some videos you may like

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
34,692
Office Version
365, 2019, 2016, 2010
Platform
Windows, MacOS
Application.Ontime will be cleared as soon as you close Excel down.
 

SBF12345

Well-known Member
Joined
Jul 26, 2014
Messages
614
Thanks RoryA,

Just to clarify, will I need to manually execute the code everytime I need to run it? or will it pickup the time criteria when it needs to run again?

Apparently the link to the website I used as the basis of my understanding of OnTime is no longer in operation. But I was under the impression that OnTime was for the purpose of allowing for the continuous function of subs requiring cyclical execution.
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
34,692
Office Version
365, 2019, 2016, 2010
Platform
Windows, MacOS
It is but only with Excel open. You need to reset the schedule each time Excel is opened.
 

SBF12345

Well-known Member
Joined
Jul 26, 2014
Messages
614
Do you know if there are other methods to collect data over a regular interval using VBA?

I suppose I could write down the schedule and click a button once a day, week, month, etc.
 

Watch MrExcel Video

Forum statistics

Threads
1,090,040
Messages
5,412,008
Members
403,407
Latest member
craigey1

This Week's Hot Topics

Top