Hi All,
I have written the code below which works however I need it to stop after the first 5 queries and run the code to update formula's. Once this has finished, then run Query 6 - 12. At the moment all the queries run and then the code to update formula's runs. I have had to split this into 3 different routines which is not ideal. Any suggestions??
By the way, Background refresh is NOT enabled.
I have written the code below which works however I need it to stop after the first 5 queries and run the code to update formula's. Once this has finished, then run Query 6 - 12. At the moment all the queries run and then the code to update formula's runs. I have had to split this into 3 different routines which is not ideal. Any suggestions??
By the way, Background refresh is NOT enabled.
Code:
Sub UpdateALL()
ActiveWorkbook.Connections("Query - 1 - RevenueImpactDeals").Refresh
ActiveWorkbook.Connections("Query - 2 - InvalidOPPs").Refresh
ActiveWorkbook.Connections("Query - 3 - MgtUpdates").Refresh
ActiveWorkbook.Connections("Query - 4 - Judgement").Refresh
ActiveWorkbook.Connections("Query - 5 - Debookings").Refresh
<< Code to update formula’s >>
ActiveWorkbook.Connections("Query - 6 - SFDC #2").Refresh
ActiveWorkbook.Connections("Query - 7 - MgtUpdates (2)").Refresh
ActiveWorkbook.Connections("Query - 8 - Judgement (2)").Refresh
ActiveWorkbook.Connections("Query - 9 - Debookings (2)").Refresh
ActiveWorkbook.Connections("Query - 10 - Append1- SFDC#2 & Mgt Updates").Refresh
ActiveWorkbook.Connections("Query - 11 - Append2-Append1 & Judgment").Refresh
ActiveWorkbook.Connections("Query - 12 - Append3-Append2 & Debookings").Refresh
End Sub
Last edited: