#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default 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.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default 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.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default 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.





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert hard coded query criteria to Parameter Query Melanie[_2_] Excel Discussion (Misc queries) 0 July 15th 08 09:59 PM
Excel 2007 / MS Query - editing existing query to another sheet Hotpepperz Excel Discussion (Misc queries) 0 June 13th 08 06:53 PM
Anyone Else Use Database Query to Query Another Sheet in the Same Excel Workbook? jocke Excel Discussion (Misc queries) 0 November 28th 05 06:37 PM
Microsoft Query rejects "nz" function in Access Query Vaughan Excel Discussion (Misc queries) 0 May 4th 05 05:20 PM
Stop to modify the SQL query manually entered into query ! Olivier Rollet Excel Programming 6 November 3rd 04 08:34 AM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"