Tuesday 2 February 2016

Excel - Macro - how to get table from the web using VBA

Watch this example on YouTube


The following macro will put table to active sheet from the following web page:
http://localhost:50006/WebForm1.aspx

Sub GetWebTable()
    With ActiveSheet.QueryTables.Add(Connection:="URL;http://localhost:50006/WebForm1.aspx", Destination:=Range("a1"))
        .Refresh BackgroundQuery:=False
        .SaveData = True
    End With
End Sub

1 comment: