I have a spreadsheet that uses Excel's data connection to pull info from various URLs.
There is some VBA code that loops a process, in order to cycle through all the URLs I need to use.
The problem is that sometimes Excel pulls in the same data two or three times in a row. My first suspicion is that the VBA was continuing on to the next part of the code before waiting for the query to finish. So I added this line of code, just before the refresh:
I'm still seeing results where it pulls the same data for two or three steps in a row, before going back to pulling one data set per step. I can't find any consistency in the error. Sometimes it works for 10 iterations, sometimes 20, etc.
Any ideas on what to try next?
There is some VBA code that loops a process, in order to cycle through all the URLs I need to use.
The problem is that sometimes Excel pulls in the same data two or three times in a row. My first suspicion is that the VBA was continuing on to the next part of the code before waiting for the query to finish. So I added this line of code, just before the refresh:
VBA Code:
WB.Connections("Query - CorrelationDownload").BackgroundQuery = False
I'm still seeing results where it pulls the same data for two or three steps in a row, before going back to pulling one data set per step. I can't find any consistency in the error. Sometimes it works for 10 iterations, sometimes 20, etc.
Any ideas on what to try next?