frustrating
Registered User.
- Local time
- Today, 12:10
- Joined
- Oct 18, 2012
- Messages
- 68
Hello:
I am trying to figure out the best way to automate the click of a link.
Basically what I want is to open the browser to a specific page and search for a pdf file (which is named arbitrarily) and click on it.
What I have here:
Isn't working. Any ideas? It loads the page fine, but won't click on a link.
I am trying to figure out the best way to automate the click of a link.
Basically what I want is to open the browser to a specific page and search for a pdf file (which is named arbitrarily) and click on it.
What I have here:
Code:
Dim IeApp As InternetExplorer
Dim sURL As String
Dim IeDoc As Object
Dim Element As HTMLLinkElement
Set IeApp = New InternetExplorer
IeApp.Visible = True
sURL = "whatever link"
IeApp.navigate sURL
Do
Loop Until IeApp.ReadyState = READYSTATE_COMPLETE
Set IeDoc = IeApp.Document
For Each Element In IeDoc.links
If Element.innerText = ".pdf" Then
Call Element.Click
Exit For
End If
Next Element