Question

im recieving a table from web in excel with the code below

With ActiveSheet.QueryTables.Add(Connection:= _
    "URL;some url")
    .WebSelectionType = "xlSpecifiedTables"
    .WebTables = "10"
    .BackgroundQuery = True
    .TablesOnlyFromHTML = True
    .Refresh BackgroundQuery:=False
    .SaveData = True
End With

but also i wanna get the row count from that table i got. so how can i achive that?

With ActiveSheet.QueryTables.Add(Connection:= _
    "URL;some url")
    .LineCount 'is it smt like this???????
End With
Was it helpful?

Solution

Why not simply use something like Range("B3").CurrentRegion.Rows.Count ?
Note that you can't know the # rows to be downloaded before actually downloading them, and since you are using .BackgroundQuery = True, you don't really know when the download is complete...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top