View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Sanjay Sanjay is offline
external usenet poster
 
Posts: 31
Default How to obtain the row count of a QueryTable from a Web query

Hi,
I could not get much info, but please refer below link which may help you.

http://www.java2s.com/Code/VBA-Excel...erywithVBA.htm

http://blogs.msdn.com/excel/archive/...b-queries.aspx

http://www.mrexcel.com/tip072.shtml


Regards,
Sanjay

Mark "Yes", if the post if helpful.


--------------------------------------------

"Felix_Jiang" wrote:

I use a Web query to obtain a table on a Web page. How can I know the number
of rows in the result QueryTable?

The current code I use is as follows:

Sub Test()
Dim MyStr As String
MyStr = "URL;http://mySite/currentuser"
With ActiveSheet.QueryTables.Add(Connection:=MyStr, _
Destination:=Range("a10"))

.RowNumbers = True
.WebSelectionType = xlSpecifiedTables
.WebTables = "11"
.BackgroundQuery = True
.TablesOnlyFromHTML = True
.Refresh BackgroundQuery:=False
.SaveData = True
End With


End Sub