We help IT Professionals succeed at work.

Macro to refresh every 5 seconds in shared workbook

SrArtemis
SrArtemis asked
on
Hello All,
Can someone tell if and how I can create a macro in excel 2000 to refresh the workbook every 5 seconds or so. It is going to be a shared workbook.

SrA
Comment
Watch Question

Commented:
Here is a timer API paste it into a new module;
' Start Here
Private Declare Sub sapiSleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)



Function sSleep(lngMilliSec As Long)
    If lngMilliSec > 0 Then
        Call sapiSleep(lngMilliSec)
    End If
End Function

' Finish here

use it like this;


Private Sub Workbook_Open()
Start:
sSleep (5000)
ActiveWorkbook.RefreshAll
Goto Start
End Sub

This should work but may not be the best solution, good luck.
Commented:
Use CTL+Break to stop it if you have any problems.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.