I've written up some VBA code that looks up a laptop based on Service Tag and extracts the End of Warranty date. I have a list of about 200 Service Tags. I've noticed that after doing searches for about 10 of them, I get an error. I've labeled the line at which it eventually fails. Any ideas as to why it eventually fails? Do I have to increase the wait time?
On another note, is there a different way you would write the VBA code for it to run much more efficiently. I would think that I would be able to go through this list rather quickly, but then again I'm new to VBA.
Sub ServiceTagSearch2()
Dim ie As InternetExplorer
Dim webpage As HTMLDocument
Set ie = New InternetExplorer
Dim mtbl As String
Dim i As Integer
Dim cellRange As Range
ie.Visible = False
Set cellRange = Range("F3:F95")
For i = 1 To 93
url = cellRange.Cells(i, 1).Value
ie.navigate url
Application.Wait (Now + TimeSerial(0, 0, 7))
Set webpage = ie.document
mtbl = webpage.getElementById("warrantyExpiringLabel").innerText <--------This is where I get the error
Cells(i + 2, 7) = mtbl
Set webpage = Nothing
Next i
End Sub
VBA code shown is for this worksheet