Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Aug 2, 2:16 pm, sloan 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? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Aug 2, 2:27 pm, KLZA wrote:
On Aug 2, 2:16 pm, sloan 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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
THX that seems to work.
"KLZA" wrote: On Aug 2, 2:27 pm, KLZA wrote: On Aug 2, 2:16 pm, sloan 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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Make sure all your queries are configured to NOT do background queries. Then
the code should wait for the query to finish before proceeding. -- Regards, Tom Ogilvy "sloan" 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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Read ".dll" files, the Macro "work flow" and the actual values of the variables when Macro is running | Excel Programming | |||
Error Help - Method "Range" of object "_Worksheet" failed. | Excel Programming | |||
ActiveWorkbook.RefreshAll deosn't work in shared mode, "calculate" doesn't either | Excel Programming | |||
What is Error "Method "Paste" of object "_Worksheet" failed? | Excel Programming | |||
Getting "compile error" "method or data member not found" on reinstall | Excel Programming |