Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
query refresh question
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
query refresh question
hi forgot to mention. not allowing a background query will add so time to the refresh process but we are not talking hours or even minutes. more like seconds. the exact time varies depending on how much data you are bringing, network traffice, other, etc. but it's not a great deal. 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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
query refresh question
thanks, i changed activeworkbook.refreshall to a cell in the query's range and added the background refresh code and it seems to work. ws.Range("A6").QueryTable.Refresh BackgroundQuery:=False -- Gary Keramidas Excel 2003 "FSt1" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
MS Query refresh question | Excel Discussion (Misc queries) | |||
Refresh Query Table causing debug error with Background Refresh pr | Excel Programming | |||
query after refresh question | Excel Programming | |||
Timing of automatic query refresh and macro pivot table refresh | Excel Programming | |||
Excel does not close from VB!! (when i refresh Refresh query with BackgroundQuery:=False) | Excel Programming |