Hi Guys,
I have the following code, After running the macro, the query's want to keep updating. I want the query's to get the data once, and then stop updating afterwards (become static text). Does anyone have a method of making the query's static text?
I think the auto updating of querys is ok when there are only a few, however I have a list of about 500, and which results in going very slow and eventually an error message coming up asking if I would like the query's to stop running, when I accept half of the querys become an error strings.
(Column B has a list of website addresses.)
Set Rng01 = Cells(3, 1)
Set Rng02 = Cells(100, 1)
'Call Functions_Module.BlanksToSkip(Rng01, "Down", Rng02, 1)
For i01 = 1 To Rng02.Row - Rng01.Row - 1
'URL = "http://www.wiseowl.co.uk/courses/"
'URL = "https://www.linkedin.com/salary/Project-Engineer-salaries-in-australia"
'Set ws = Worksheets.Add
'Set qt = ws.QueryTables.Add(Connection:="URL;" & URL, Destination:=Range("A1"))
URL = Cells(2 + i01, 2)
Set Rng01 = Cells(2 + i01, 4)
Set qt = ActiveSheet.QueryTables.Add(Connection:="URL;" & URL, Destination:=Rng01)
With qt
' .RefreshOnFileOpen = True
' .RefreshPeriod = 5 ' (5 = 5 minutes, 0 will not refresh automatically)
' .Name = "OWLCourses"
' .WebFormatting = xlWebFormattingRTF
.WebSelectionType = xlEntirePage
' .WebTables = "3"
' .WebTables = "1,2"
.Refresh
End With
Application.Wait (Now + TimeValue("0:00:5"))
Next i01
End Sub
Bookmarks