View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike Fogleman Mike Fogleman is offline
external usenet poster
 
Posts: 1,092
Default hyperlinks.follow result saving

You will want to do a Web Query. Much easier to get the data to a specific
worksheet area.

Sub GetData()
Dim hypadr As String

hypadr = "http://example.microsoft.com"
With Worksheets("Sheet1").QueryTables.Add(Connection:=" URL;" & hypadr _
, Destination:=Worksheets("Sheet1").Range("C1"))
.Name = ""
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlAllTables
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.Refresh BackgroundQuery:=False
End With
End Sub

Mike F

"ezil" wrote in message
...
I am using "hyperlinks.follow" method to download data from website.
The example for this method shows saving the result in new window as

ActiveWorkbook.FollowHyperlink Address:="http://example.microsoft.com", _
NewWindow:=True

But I require to paste or save the result in some range like (range c1 to
H1)
of the active worksheet. New window not required.
How to do this? Please help me.