I have the following Macro to refresh my workbook. At this point, this is the same as clicking on the refresh all button. Is there a time element that I can add to this code to get it to refresh all data connections and all calculations on all the worksheets in my workbook every 15 minutes.
The workbook has cells pulling data from SharePoint list items and contain typical formula calculations as well.
Sub Workbook_RefreshAll()
ActiveWorkbook.RefreshAll
End Sub
You can use the
Application.OnTime
method to schedule a macro to be run in the future: https://msdn.microsoft.com/en-us/library/office/ff196165.aspxYet, this is a one time event only. To make it recursive, you'll have to include in that macro (yet again) another
Application.OnTime
to ensure a calling "every 15 minutes".to refresh all calculations you can use:
P.S.: Sorry my english
Enter the following in a standard module:
To begin the process run
StartTimer()
and to end the process runStopTimer()
Adapted from Chip Pearson's Site
I used some Shapes to run the macros: