Auto Update after certain time period (60 sec)

M

mrdelia

How can I set up a workbook to automatically update the data it retrieves
from other sources every 60 seconds. I can update manually by pressing F9 but
I would like it to be automatic.
 
M

mrdelia

Thank you,

I have tried OnTime with no success. It seems to update once and then stop.
How can I get it to return to the OnTime statement. I tried GoTo but locked
the spreadsheet up.
 
D

Don Guillett

Here is one I wrote for a client that may be of use

Option Private Module
Public RunWhen As Double
Public Const cRunIntervalSeconds = 600 '600 seconds=10 minutes
Public Const cRunWhat = "updateTA" '"The_Sub"
Sub StartTimer()
RunWhen = Now + TimeSerial(0, 0, cRunIntervalSeconds)
Application.OnTime earliesttime:=RunWhen, procedure:=cRunWhat, _
schedule:=True
End Sub
Sub StopTimer()
On Error Resume Next
Application.OnTime earliesttime:=RunWhen, _
procedure:=cRunWhat, schedule:=False
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top