I don't understand your logic of attempting a background refresh
(asynchronous) then waiting in code for 10 seconds anyway. Why not just do a
synchronous refresh, so the code waits until the refresh is complete ?
Anyway, it may depend on the type of query that underlies the QT:
<From Help for the Refresh Method>
BackgroundQuery Optional Variant. Used only with query tables based on the
results of an SQL query. True to return control to the procedure as soon as
a database connection is made and the the query is submitted (the query is
updated in the background). False to return control to the procedure only
after all data has been fetched to the worksheet. If this argument isn't
specified, the setting of the BackgroundQuery property determines the query
mode.
</From Help for the Refresh Method>
NickHK
"GorKo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I attempt to referesh column using the query and it is not happening
> as long as macro is running so I can not combine this macro with
> following one, what do I do wrong?
>
> Sub UpdateSafety()
> '
> ' UpdateSafety Macro
> ' Macro recorded 5/4/2007 by dispatch
> '
> Sheets("Review").Select
> Range("A1").Select
> Selection.QueryTable.Refresh BackgroundQuery:=True
>
> Application.Wait Now + TimeSerial(0, 0, 10)
>
> Sheets("ISC METS").Select
> Range("A6").Select
>
> End Sub
>
|