View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Candyman Candyman is offline
external usenet poster
 
Posts: 66
Default Pause code for data return

I currently have several worbooks that run queries against a database and
create reports. I want to open and loop through the workbooks using another
workbook to open and run a grouped reporting macro. Data is brought into
Excel by the statement " With
ActiveSheet.QueryTables.Add(Connection:=ConnectStr ing,
Destination:=Range(DataTarget), Sql:=mySQL)
.Refresh (BackgroundQuery = False)
End With"
This is a part of a three step grouped code (GetData, CreateReports,
PublishReports). The CreateReports code does not wait for the data to return.
How can I force the code to pause during this data return?