View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dick Kusleika[_3_] Dick Kusleika[_3_] is offline
external usenet poster
 
Posts: 599
Default reading html when hyperlink address not hyperlink text diplayed

Kevin

Create a hyperlink in E16 and use set it to the webpage you want. Use the
Text To Display box to set up how you want it to read in Excel. Then change
your macro like this

..Navigate Worksheets("Sheet1").Range("E16").Hyperlinks(1).Ad dress


--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"Kevin" wrote in message
...
The following code works only when the value of E16 is the filename plus

path. I need E16 to be a hyperlink such that the display value is different
from the actual filename plus path; e.g., display = Metadata, filename plus
path = C:\My Documents\demo.html

How would I modify this code to make this work?

Thanks.


Kevin

Sub Demo()
Dim ie As Object
Dim nFile As Integer
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = False
.Silent = True
.Navigate Worksheets("Sheet1").Range("E16").Select
Do Until Not .Busy
DoEvents
Loop
Worksheets("Sheet1").Range("E1") =

..Document.DocumentElement.InnerText
.Quit
End With
Set ie = Nothing
End Sub