Hyperlinks(1).Follow then open as .html

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a macro that opens a webpage as .html and extracts information. I
need to have the macro to then Follow a hyperlink on that webpage and then
open that page as .html for ectracting more data. I have the Follow part OK.

Is there an instruction to have the macro activate the URL and open it as
..html?

Thanks,
 
I found the solution.
This is the bare bones of it.

sub getlinks()
Workbooks.Open Filename:="http://www.mywebsite.com"
'get data from this page
Range("C14").activate ' the cell with the hyperlink
Workbooks.Open Filename:=selection.hyperlinks(1).address
'continue
end sub

If the hyperlink is an abbreviation of the actual address you may need
Workbooks.Open Filename:="http://www.mywebsite/" & _
mid(selection.hyperlinks(1).address,3,20)
 
Back
Top