Thread: Refresh
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
ceemo
 
Posts: n/a
Default Refresh


Please see the previous posts.

I couldnt get them to work but i did manae to modify the code to the
below and it works for one refresh at 20 minutes past but doesnt
refresh after that. want it to keep refresh over and over if
possible?

Please can you help?

Option Explicit

Dim dNext As Date

Sub Auto_Open()

dNext = TimeSerial(Hour(Now) + IIf(Minute(Now) < 20, 0, 1), 20, 0)
Application.OnTime dNext, "refreshdata"
Workbooks(ActiveWorkbook.Name).RefreshAll
End Sub

Sub refreshdata()
dNext = TimeSerial(Hour(dNext) + 1, 20, 0)
Application.OnTime dNext, "refreshdata"
Workbooks(ActiveWorkbook.Name).RefreshAll
End Sub

Sub cancelTimer()
Application.OnTime dNext, "refreshdata", , False
End Sub


--
ceemo
------------------------------------------------------------------------
ceemo's Profile: http://www.excelforum.com/member.php...o&userid=10650
View this thread: http://www.excelforum.com/showthread...hreadid=550248