Auto Refresh

G

George

I am using a shared Excel 2007 spreadsheet on a work LAN. Is there some code
I can add to it to have it auto refresh at a preset interval.
 
G

George

Thanks that works - but the only thing I could find that I think
is refreshing the screen is the Save function, everything else gives
me an error message.

George
 
A

AFSSkier

George,

Put this code in your sub: ThisWorkbook.RefreshAll (see below)

Private Sub Workbook_BeforeClose(Cancel As Boolean)

Application.OnTime dTime, "MyMacro", , False

End Sub

Private Sub Workbook_Open()

Application.OnTime Now + TimeValue("00:00:15"), "MyMacro" 'test time set
to 15 sec

End Sub
'Place the following in any Standard Module (Insert>Module)
Public dTime As Date
Sub MyMacro()
dTime = Now + TimeValue("00:00:15")
Application.OnTime dTime, "MyMacro"

ThisWorkbook.RefreshAll

MsgBox "Hooray my code works! All sheets are Refreshed"

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top