Hello all,
I am trying to click a little plus sign to expand a selections menu that appears after login as part of an IE automation. I have tried every click in the book, hopefully besides the one y'all have. Here's the code I've used to get into the website, as well as a picture of the HTML when already logged in. the highlighted img is what I'm trying to click. The main issue is that the td id "ext-element-6" changes every time I login. I've seen it as "ext-element-6" all the way up to "ext-element-50". Thanks!
I am trying to click a little plus sign to expand a selections menu that appears after login as part of an IE automation. I have tried every click in the book, hopefully besides the one y'all have. Here's the code I've used to get into the website, as well as a picture of the HTML when already logged in. the highlighted img is what I'm trying to click. The main issue is that the td id "ext-element-6" changes every time I login. I've seen it as "ext-element-6" all the way up to "ext-element-50". Thanks!
VBA Code:
Sub Help()
Dim IE As New SHDocVw.InternetExplorer
Dim HTMLDoc As MSHTML.HTMLDocument
Dim HTMLDoc2 As MSHTML.HTMLDocument
Dim HTMLInput As MSHTML.HTMLDocument
Dim Buttons As MSHTML.IHTMLElementCollection
Dim Button As MSHTML.IHTMLElement
Dim Bs As MSHTML.IHTMLElementCollection
Dim B As MSHTML.IHTMLElement
Dim Start_Date As Integer
Dim End_Date As Integer
Dim rNum As Integer
Dim cNum As Integer
Dim tRows As Object
Dim temp As Object
Dim Table As Object
Dim tHead As Object
Dim tCells As Object
Dim np As Variant
Dim numPages As String
Dim elements As Object
Dim element As Object
Dim doc As MSHTML.HTMLDocument
Dim img As MSHTML.HTMLImg
IE.Visible = True
IE.Navigate "www.google.com"
Do While IE.Busy: DoEvents: Loop
Do Until IE.ReadyState = READYSTATE_COMPLETE: DoEvents: Loop
Set HTMLDoc = IE.Document
HTMLDoc.forms("frmLogin").elements("userLogin").Value = "testu"
HTMLDoc.forms("frmLogin").elements("userPassword").Value = "testp"
HTMLDoc.getElementById("loginButtonBg").Click
'please help here
End Sub