Refresh Query Table causing debug error with Background Refresh pr
hi
it has been my experence never to have a query refresh in the background
perticularly if a macro is running and very perticularly if the macro may be
using the data being refreshed. you didn't say how many queries you have and
i think the refreshall command may be the source of your problems.(i've had
problems with that) refreshing every minute may also be a contributing
factor if you have a large number of queries.
i would increase the amout of time between refreshes if possible and refresh
each query 1 at a time and NOT in the background.
sheets("sheet1").range("A1").querytable.refresh backgroundquery:=false
you would need a refresh line like above for each query.
Regards
FSt1
"Gum" wrote:
I have query tables in a worksheet that I wish to get refreshed each time a
macro is executed. The query tables are set to refresh data from SQL
database every minute (via Data...Connections...properties). However, when
the macro is executed, there is an error whenever the background refresh
process is taking place. Is there some way of getting around this eg.
knowing whether the background refresh process is taking place and starting
the refresh process after?
Is there a better refresh macro that will only refresh the query table and
not the entire worksheet?
Macro:
sub Rfresh()
ActiveWorkBook.RefreshAll
end sub
|