I need to startup a workbook and initially run 2 queries.
I am doing this by
...
Workbook_Open()
RefreshAll
...
Once the refresh has finished I need to run some further code.
The problem I have is that I cannot successfully capture the moment when the last query has finished it's refresh.
I have looked into QuesryTable_AfterRefresh (code below) but this event is not being fired at all.
Private Sub QueryTable_AfterRefresh(Success As Boolean)
If Success
' Query completed successfully
Else
' Query failed or was cancelled
End If
End Sub
I also looked at the .refreshing property and put this in a repeating Do_While_Loop as per following example code ...
Do While Worksheet("ABC"
.QueryTable(1).Refreshing
Loop
' code to execute after refresh finished.
Can anyone offer any advice or proven solutions to this one.
Thnaks,
I am doing this by
...
Workbook_Open()
RefreshAll
...
Once the refresh has finished I need to run some further code.
The problem I have is that I cannot successfully capture the moment when the last query has finished it's refresh.
I have looked into QuesryTable_AfterRefresh (code below) but this event is not being fired at all.
Private Sub QueryTable_AfterRefresh(Success As Boolean)
If Success
' Query completed successfully
Else
' Query failed or was cancelled
End If
End Sub
I also looked at the .refreshing property and put this in a repeating Do_While_Loop as per following example code ...
Do While Worksheet("ABC"
Loop
' code to execute after refresh finished.
Can anyone offer any advice or proven solutions to this one.
Thnaks,