View Full Version : Excel Refresh


.Justin,
10-23-2010, 11:25 AM
Hi All,

My friend has given be the following code to use for my spreadsheet to update automatically. It currently does this every minute. Is it possible to allow this to happen every 10 seconds and if so where do I change the code? As I can see nothing obvious.

Thanks

Public RunWhen As Double
Public Const cRunIntervalSeconds = 60
Public Const cRunWhat = "TheSub"

Sub StartTimer()

RunWhen = Now + TimeSerial(0, 0, cRunIntervalSeconds)
Application.OnTime earliesttime:=RunWhen, procedure:=cRunWhat, _
schedule:=True
End Sub
Sub TheSub()
'
Calculate
'
StartTimer

End Sub
Sub StopTimer()
On Error Resume Next
Application.OnTime earliesttime:=RunWhen, _
procedure:=cRunWhat, schedule:=False
End Sub

vicodin
10-25-2010, 03:11 AM
Public Const cRunIntervalSeconds = 10

namliam
10-25-2010, 04:20 AM
As I can see nothing obvious.
Were you able to find 2 matching socks today???

Must be hard in the dark...

LOL ???
http://www.access-programmers.co.uk/forums/showthread.php?t=184191