Hello guys,
I’m trying to fill a web form for filling multiple boxes trough vba, the website works this way...
You input a ticket number, the website redirects you to the main HUB and from there you gotta fill 40 boxes, but the problem is that every time that I enter a new ticket number the Name box and ID box changes..
Is there a way to use the VBA code to use the tabindex and not the name or id box ?
Take a look on my code and give me your thoughts on this, it will be highly appreciated,
Sub FillIE()
Dim ie As New InternetExplorer
Dim LookUpAddress As String
Dim LookUpCity As String
Dim LookUpZip As String
Dim HtmlDoc As HTMLDocument
Dim WS As Worksheet
Set WS = ActiveSheet
'Load webpage and loop until loading is complete.
ie.Navigate " Insert Website in here"
Do Until ie.ReadyState = READYSTATE_COMPLETE
Loop
Set HtmlDoc = ie.document
With ie
.Visible = True
.AddressBar = True
.Toolbar = True
End With
LookUpAddress = WS.Cells(1, 2)
LookUpCity = WS.Cells(2, 2)
LookUpZip = WS.Cells(3, 2)
'problem is here I want to assign the tabindex of the HTML code
HtmlDoc.forms("addressLookupForm").address.Value = LookUpAddress
HtmlDoc.forms("addressLookupForm").city.Value = LookUpCity
HtmlDoc.forms("addressLookupForm").zipCode.Value = LookUpZip
'Close ie object
Set ie = Nothing
End Sub
Regards,
I’m trying to fill a web form for filling multiple boxes trough vba, the website works this way...
You input a ticket number, the website redirects you to the main HUB and from there you gotta fill 40 boxes, but the problem is that every time that I enter a new ticket number the Name box and ID box changes..
Is there a way to use the VBA code to use the tabindex and not the name or id box ?
Take a look on my code and give me your thoughts on this, it will be highly appreciated,
Sub FillIE()
Dim ie As New InternetExplorer
Dim LookUpAddress As String
Dim LookUpCity As String
Dim LookUpZip As String
Dim HtmlDoc As HTMLDocument
Dim WS As Worksheet
Set WS = ActiveSheet
'Load webpage and loop until loading is complete.
ie.Navigate " Insert Website in here"
Do Until ie.ReadyState = READYSTATE_COMPLETE
Loop
Set HtmlDoc = ie.document
With ie
.Visible = True
.AddressBar = True
.Toolbar = True
End With
LookUpAddress = WS.Cells(1, 2)
LookUpCity = WS.Cells(2, 2)
LookUpZip = WS.Cells(3, 2)
'problem is here I want to assign the tabindex of the HTML code
HtmlDoc.forms("addressLookupForm").address.Value = LookUpAddress
HtmlDoc.forms("addressLookupForm").city.Value = LookUpCity
HtmlDoc.forms("addressLookupForm").zipCode.Value = LookUpZip
'Close ie object
Set ie = Nothing
End Sub
Regards,