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!
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Belated thank you, I just put together and tested a number of timing subs using the material on the link provided. Thanks again!
 
Upvote 0
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 :)
 
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top