View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tim Williams Tim Williams is offline
external usenet poster
 
Posts: 1,588
Default VBA Click a link

Should work, but hard to tell why it doesn't without seeing the page you're
working on.

Tim

"GTVT06" wrote in message
...
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