문제

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
도움이 되었습니까?

해결책

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...

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top