VBA Click a link

  • Thread starter Thread starter GTVT06
  • Start date Start date
G

GTVT06

Hello,
I'm trying to click a link inside of a frame in Internet Explorer. For
some reason my code below doesn't click it. The Debug.Print recognizes
the link but the link.Click isn't working for some reason.
This is my 1st time trying to click on a link inside of a frame so
maybe it's done different from how I'm trying?

For x = 0 To IE.Document.frames.Length - 1
Set f = IE.Document.frames(x)
For Each link In f.Document.Links
If link.innerText = "Download" Then
link.Focus
link.Click
Do While IE.Busy And Not IE.readyState = 4:
Loop
Exit For
End If
Debug.Print "Frame " & x & ": " & link.innerText
Next link
Next x
 
Should work, but hard to tell why it doesn't without seeing the page you're
working on.

Tim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top