I am using the command Activeworkbook.RefreshAll in a spreadsheet, referring
to a data table earlier gathered using the command:
ActiveWorkbook.XmlImport URL:=
http://xxx.xxx.xxx.xxx, ImportMap:=Nothing,
Overwrite:=True, Destination:=Sheets("Sheet1").Range("$A$3")
It's being used in a timer programme to refresh every 1 second - see below.
The idea is to refresh my data from the network every second.
My problem is that in Office 2003 it won't refresh at all, even when I set
the timer to refresh at 10 seconds or 30 seconds.
In 2007 it will refresh, but every 5 seconds max. I'm on a very fast
connection which I know can support the data transfer at that speed.
Any ideas?
Sub StartTimer()
'Application.ScreenUpdating = False
TimerSeconds = 1 ' how often to "pop" the timer.
TimerID = SetTimer(0&, 0&, TimerSeconds * 1000&, AddressOf TimerProc)
' Application.ScreenUpdating = True
End Sub
Sub EndTimer()
KillTimer 0&, TimerID
End Sub
Sub TimerProc(ByVal HWnd As Long, ByVal uMsg As Long, _
ByVal nIDEvent As Long, ByVal dwTimer As Long)
ActiveWorkbook.RefreshAll
End Sub