query refresh question
hi
the freshall command allows for a background querry and it has been my
experience never to allow a background query perticularly if you are going to
be manipulating the query data with more code. the code could start
manipulated data before it is refreshed ie processing old data.
what i always do is refresh each query one at a time by referencing the
query data range.
Application.StatusBar = "refreshing query1"
sheets("sheet1"). range("A1").querytable.refresh Backgroundquery:=False
Application.StatusBar = "refreshing query2"
sheets("sheet2"). range("A1").querytable.refresh Backgroundquery:=False
Application.StatusBar = "refreshing query3"
sheets("sheet3"). range("A1").querytable.refresh Backgroundquery:=False
Application.StatusBar = ""
msgbox "I'm done refreshing now"
more code here.
regards
FSt1
"Gary Keramidas" wrote:
i have some code that loops to do multiple queries.
i just use ActiveWorkbook.RefreshAll to refresh with the current parameters.
just have trouble because the code continues running before the query is
finished.
what's the best way to determine when the query is done so i can manipulate
the data before the next query runs?
--
Gary Keramidas
Excel 2003
|