ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Retrieving consecutive pages in web query What's wrong here? (https://www.excelbanter.com/excel-programming/438645-retrieving-consecutive-pages-web-query-whats-wrong-here.html)

Herman[_2_]

Retrieving consecutive pages in web query What's wrong here?
 
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&int ern=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

Don Guillett

Retrieving consecutive pages in web query What's wrong here?
 
true&page=" & i + 1 & "&count=100&
also comment out .name
I would have written using a refresh and moving the result to another sheet.
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Herman" wrote in message
...
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&int ern=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




All times are GMT +1. The time now is 10:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com