On Aug 2, 2:27 pm, KLZA <clawd...@gmail.com> wrote:
> On Aug 2, 2:16 pm, sloan <sl...@discussions.microsoft.com> wrote:
>
> > i can get it to work when i step through my macro, but not when i run the
> > whole macro. i've even tried to put a "wait" into the macro, but it waits
> > with "connecing to data source" in bottom left corner.
>
> What's the VB code you are using and where is it placed?
You can try this macro in your ThisWorkbook object..
Private Sub Workbook_Open()
me.RefreshAll
End Sub
Or you can create a macro named Auto_Open with the following code..
Sub Auto_Open()
ActiveWorkbook.RefreshAll
End Sub
Included wait...
Sub Auto_Open()
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 10 'waits 10 seconds
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
ActiveWorkbook.RefreshAll
MsgBox "Refreshed!"
End Sub
|