VB runtime error in debugger...please help
I successfully ran this code yesterday, but today it is hanging up at this line and I'm not sure how to fix:
Set arr = ie.Document.getElementsByClassName("Button_Partner Style")
<input type="submit" class="Button_PartnerStyle" value="TRACK IT" onclick="checkVariables()">
The code is as follows:
Set ie = CreateObject("InternetExplorer.Application")
my_url = "https://partners.lasership.com/Partners/"
With ie
.Visible = True
.Navigate my_url
Do Until Not ie.Busy And ie.ReadyState = 4
DoEvents
Loop
End With
' Input the userid and password
ie.Document.getElementsByName("USER").Item(0).Valu e = "xxxxx"
ie.Document.getElementsByName("PASS").Item(0).Valu e = "xxxxx"
ie.Document.getElementsByName("imageField").Item(0 ).Click
ie.Navigate "https://partners.lasership.com/Partners/ComponentsC/jobs/Tracking_Quick_02.cfm"
Do Until Not ie.Busy And ie.ReadyState = 4
DoEvents
Loop
ie.Document.getElementsByName("start").Item(0).Val ue = Format(Forms("Laser Form")![Start Date], "mm/dd/yy")
ie.Document.getElementsByName("end").Item(0).Value = Format(Forms("Laser Form")![End Date], "mm/dd/yy")
ie.Document.getElementsByName("theID").Item(0).Val ue = Forms("Laser Form")![Client Number]
Set arr = ie.Document.getElementsByClassName("Button_Partner Style")
For Each a In arr
a.Click
Next a
Do Until ie.Document.ReadyState = "complete"
Loop
Set arr = ie.Document.getElementsByClassName("Button_Partner Style")
For Each a In arr
If a.Value = "TRACK IT" Then
a.Click
Exit For
End If
Next a
Do Until ie.Document.ReadyState = "complete"
Loop
Set arr = ie.Document.getElementsByName("Type")
For Each a In arr
If a.Value = "submit" Then
a.Click
Exit For
End If
Next a
End Sub
|