I have used the following code to successfully pull in data on email into Excel:
Set ElementCol = html.getElementsByTagName("a")
For Each Link In ElementCol
If InStr(Link, "mailto:") Then
Cells(MyRow, MyCol).Value = Link
Cells(MyRow, MyCol).Select
MyCol = MyCol + 1
End If
Next 'email address loop
This relates to:
However, I can't use similar code to pull in the name:
I have tried getElementById()
and getElementsByClassName
and I have tried changing html.
to doc.
and Text.
because I thought the issue could be that an email address is a hyperlink so html.
is appropriate but a name is plain text so I should use something else? I am getting Object Required error.