Executing a Subroutine on a cyclical basis using time as a condition for execution

SBF12345

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

I am interested in building a subroutine that imports external data from using a web query on a cyclical basis, one day, one week, one month, or one quarter. I would like to know if anyone has experience in doing this and if so how might be best to structure the block of code that determines the time to execute the subroutine. I would like to be able to have the subroutines execute automatically so that I don't have to manually click buttons to update the retrieved data. Is it possible to do this with excel closed, or do I need to keep a workbook open to enable the execution of subroutines on timers?

Thanks!
 

Some videos you may like

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

SBF12345

Well-known Member
Joined
Jul 26, 2014
Messages
614
Belated thank you, I just put together and tested a number of timing subs using the material on the link provided. Thanks again!
 

iliace

Well-known Member
Joined
Jan 15, 2008
Messages
3,542
Cool, glad it worked! Personally, I have only used Application.OnTime and Application.Wait for timing, never the long-term scheduling.

If you achieved the result you are looking for, consider posting the details for anyone researching this type of solution in the future :)
 

SBF12345

Well-known Member
Joined
Jul 26, 2014
Messages
614
Maybe I spoke too soon, I am unable to close the workbooks and turn off the computer while keeping the time values intact. So it does and does not accomplish the goals of the project.
 

iliace

Well-known Member
Joined
Jan 15, 2008
Messages
3,542
Maybe I spoke too soon, I am unable to close the workbooks and turn off the computer while keeping the time values intact. So it does and does not accomplish the goals of the project.
:-/ sorry to hear that.

Can you post back with the specifics of how you set it up, and the ways in which it is not working? Perhaps we can troubleshoot.
 

Watch MrExcel Video

Forum statistics

Threads
1,099,082
Messages
5,466,537
Members
406,485
Latest member
kaksolver

This Week's Hot Topics

Top