Can anybody tell me how to insert a web query in an Excel-sheet?
I want to create an Excel document that automatically contains a web query to fill the sheet with data provided by a url.
In Excel I recorded a macro just to see the VB code that it generates:
With ActiveSheet.QueryTables.Add(Connection:="URL;
http://www.google.com", _
Destination:=Range("$A$1"))
.Name = "www.google.com"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = True
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
Thanks!