Running the following query to grab some data from steam charts:
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://steamcharts.com/app/" & games(x), Destination:=Range("A" & lastRowData))
.Name = " & games(x) & "
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlAllTables
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=True
End With
Then I have other actions afterwords like
//Run analysis
The issue I'm running into is that while the script executes correctly, the "analysis" portion runs but doesn't work as expected because while the query loads, it takes maybe 5 seconds to do so, and the script executes immediately instead of waiting for the previous data to load before working. Is there a way to delay execution of subsequent script commands until all data is loaded in the spreadsheet?