ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Web query (https://www.excelbanter.com/excel-programming/390137-web-query.html)

Vijay Kotian

Web query
 
In Macros i would like to write web query to extract data which consist of
more than 1500 rows, In Visual Basic the tables are mentioned as under
..WebTables = "3"

How can i mention 1500 tables by writing FOR Next....

or any other alternative.

Don Guillett

Web query
 
A for/next loop. How about the actual url and an your web query macro

--
Don Guillett
SalesAid Software

"Vijay Kotian" wrote in message
...
In Macros i would like to write web query to extract data which consist of
more than 1500 rows, In Visual Basic the tables are mentioned as under
.WebTables = "3"

How can i mention 1500 tables by writing FOR Next....

or any other alternative.



Vijay Kotian

Web query
 
Actual Web URL is "URL;http://www.sebi.gov.in/FIIIndex.jsp?fiiIndxName=O",
Destination:=Range( _
"A1"))
.Name = "FIIIndex.jsp?fiiIndxName=%"

it consist of more that 1500 rows and it requires to be ticked individually.
The macro for the same is as under;

With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.sebi.gov.in/FIIIndex.jsp?fiiIndxName=O",
Destination:=Range( _
"A1"))
.Name = "FIIIndex.jsp?fiiIndxName=%"
.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 = xlWebFormattingNone

X = 3

For X = 3 To 1500

.WebTables = X

Next X


.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With

I am not getting all data from the above For Next ........... Can you
please suggest any other alternative to get full data.

Thank you

"Don Guillett" wrote:

A for/next loop. How about the actual url and an your web query macro

--
Don Guillett
SalesAid Software

"Vijay Kotian" wrote in message
...
In Macros i would like to write web query to extract data which consist of
more than 1500 rows, In Visual Basic the tables are mentioned as under
.WebTables = "3"

How can i mention 1500 tables by writing FOR Next....

or any other alternative.




NickHK

Web query
 
If you use:
..WebSelectionType = xlEntirePage

instead and delete the ".WebTables", you will get the whole page.
This does seem to be an incredibly slow server/connection, so it will take a
while.

With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.sebi.gov.in/FIIIndex.jsp?fiiIndxName=%",
Destination:=Range("A1"))
.Name = "AllEntries"
'....
.WebSelectionType = xlEntirePage
'....
.Refresh BackgroundQuery:=False
End With


NickHK

"Vijay Kotian" wrote in message
...
Actual Web URL is

"URL;http://www.sebi.gov.in/FIIIndex.jsp?fiiIndxName=O",
Destination:=Range( _
"A1"))
.Name = "FIIIndex.jsp?fiiIndxName=%"

it consist of more that 1500 rows and it requires to be ticked

individually.
The macro for the same is as under;

With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.sebi.gov.in/FIIIndex.jsp?fiiIndxName=O",
Destination:=Range( _
"A1"))
.Name = "FIIIndex.jsp?fiiIndxName=%"
.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 = xlWebFormattingNone

X = 3

For X = 3 To 1500

.WebTables = X

Next X


.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With

I am not getting all data from the above For Next ........... Can you
please suggest any other alternative to get full data.

Thank you

"Don Guillett" wrote:

A for/next loop. How about the actual url and an your web query macro

--
Don Guillett
SalesAid Software

"Vijay Kotian" wrote in message
...
In Macros i would like to write web query to extract data which

consist of
more than 1500 rows, In Visual Basic the tables are mentioned as under
.WebTables = "3"

How can i mention 1500 tables by writing FOR Next....

or any other alternative.







All times are GMT +1. The time now is 01:29 AM.

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