Public Sub ImportWeb()
Dim qt As QueryTable
Set qt = ActiveSheet.QueryTables.Add(Connection:=" URL;http://finance.yahoo.com/q?s=^DJI&d=v1", _
Destination:=Range("A1"))
With qt
.name = "DJIQuery"
.WebSelectionType = xlSpecifiedTables
.WebTables = "16" ' DJI table
.WebFormatting = xlWebFormattingNone
.EnableRefresh = True
.RefreshPeriod = 5 'Unit in minutes
.Refresh 'Execute query
End With
Set qt = Nothing
End Sub
|