Hi Everyone,
Can anyone pls help me out to get the below mentioned VBA code working.
Public RunWhen As Double
Public Const cRunIntervalSeconds = 5
Public Const cRunWhat = "The_Sub"
Sub StartTimer()
RunWhen = Now + TimeSerial(0, 0, cRunIntervalSeconds)
Application.OnTime earliesttime:=RunWhen, procedure:=cRunWhat, _
schedule:=True
End Sub
Sub The_Sub()
MsgBox ""
'
' your code here
'
StartTimer
End Sub Sub StopTimer()
On Error Resume Next
Application.OnTime earliesttime:=RunWhen, _
procedure:=cRunWhat, schedule:=False
End Sub
Actually with the help of this VBA code I am looking to refresh my data every 5 seconds which is taken from an external data source. The help will be appreciated.
With Regards,
RAJ.
Bookmarks