Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default hyperlinks.follow result saving

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default hyperlinks.follow result saving

Thanks for your suggestion

My aim is to download .csv files. For that when I use web query method all
data get downloaded in single column and again i have to convert it into
multiple column. But if i use hyperlinks.follow method the result download
automatically
comes in multiple columns. So there is no need for conversion.

"Mike Fogleman" wrote:

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.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default hyperlinks.follow result saving

Then use the Text Import method of external data:

Sub GetData()
Dim hypadr As String

hypadr = "http://example.microsoft.com"
With Worksheets("Sheet1").QueryTables.Add(Connection:=" TEXT;" & hypadr _
, Destination:=Worksheets("Sheet1").Range("C1"))
.Name = ""
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = xlWindows
.TextFileStartRow = 1 'import from this row
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = True 'uses the comma
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1) 'need a 1 for each column
to import
.Refresh BackgroundQuery:=False
End With
End Sub

Mike F
"ezil" wrote in message
...
Thanks for your suggestion

My aim is to download .csv files. For that when I use web query method all
data get downloaded in single column and again i have to convert it into
multiple column. But if i use hyperlinks.follow method the result download
automatically
comes in multiple columns. So there is no need for conversion.

"Mike Fogleman" wrote:

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.






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding row to sheet; having hyperlinks follow Ryan Vande Excel Worksheet Functions 2 October 18th 09 02:40 AM
make hyperlinks follow the copied sheet, not the original dadouza Excel Discussion (Misc queries) 3 October 8th 07 02:29 PM
Choosing window to follow hyperlinks within workbook klasen Excel Programming 0 September 21st 06 08:16 PM
Hyperlinks(1).Follow then open as .html Pops Jackson Excel Programming 1 September 20th 06 02:21 PM
Keyboard shortcut to follow hyperlinks? Jack Kohn Links and Linking in Excel 2 December 18th 04 01:05 AM


All times are GMT +1. The time now is 02:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"