0

I've looked at the replies here : old similar post, tried everything but nothing worked. I have tried:

  1. Disabling the background refresh, problem here the execution time for individual queries takes forever.
  2. Wait method, the wait method pauses the refresh all method which defeats the purpose.
  3. I also tried after refresh but did not trigger it.

I have 71 power queries that runs on refresh all. The results for these queries are in hidden sheets, and I have one main sheet that contains links to individual cells in the hidden sheets. As i mentioned all the remaining sheets are hidden.

There is no way so far to automate the entire experience after the refresh process. I have to intervene and do the work manually.

I need a way to tell VBA to not execute the following code until the refresh of all these queries and return their results.

Please Help!!

SpeedDemon
  • 11
  • 1
  • 2
  • Maybe something along the lines of: `If Not Application.CalculationState = xlDone Then DoEvents`, would that work? If that doesn't work for you, maybe put it in a `Do Until` loop – JvdV Nov 18 '19 at 10:55
  • 1
    Use: `Application.CalculateUntilAsyncQueriesDone` – Rory Nov 18 '19 at 11:00
  • @Rory, that's the one =) – JvdV Nov 18 '19 at 11:01
  • Thank you @JvdV, I am not sure if it would, I need more info on where should i insert this snippet of code? – SpeedDemon Nov 18 '19 at 11:06
  • Thanks a million @Rory, your suggestion is right on, I am able to trigger the refresh all method, and hold the subsequent lines from executing until the refresh finalizes. – SpeedDemon Nov 18 '19 at 11:50

0 Answers0