Retrieving consecutive pages in web query What's wrong here?

H

Herman

Hello
How come I keep always getting the same 100 items instead of the next
100? I wrote this code , of which I do not understand every line but
something similar worked in other queries.
Could you help? I'd be very gratefull.
Herman
Sub Macro5()
Dim i As Integer
For i = 0 To 3
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.iec-iab.be/nl/diensten/zoeken/Pages/
Zoeken.aspx?all=true&page=i+1&count=100&ext=on&intern=on" _
, Destination:=Range("$A$1").Offset(i * 103, 0))

.Name = "Zoeken.aspx?all=true&page=i
+1&count=100&ext=on&intern=on"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingAll
.WebTables = 5
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
.Delete
End With
Next i
End Sub
 
D

Don Guillett

true&page=" & i + 1 & "&count=100&
also comment out .name
I would have written using a refresh and moving the result to another sheet.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top