I'am trying to run the below code in Explorer 11. It was running fine in Explorer 9/8 but I am getting this error when trying to run it in Explorer 11.
Run Time Error '424' object required
I think there is something missing but unable to get it. Please see below the part of code.
Sub Extract_StatusUS_test()
Dim SheetName
Dim a As InternetExplorer
Dim OnlyPatNum
Dim IEelement As Object
OnlyPatNum = "7989466"
Set a = New InternetExplorer
a.navigate "http://portal.uspto.gov/external/portal/pair"
a.Visible = True
Do
Loop Until a.readyState = READYSTATE_COMPLETE
MsgBox ("Click OK after entering the re-captcha")
Application.Wait Now + TimeValue("00:00:05")
Do
Loop Until a.readyState = READYSTATE_COMPLETE
Application.Wait Now + TimeValue("00:00:04")
Dim inp
If Len(OnlyPatNum) > 7 Then
For Each inp In a.document.getElementsByTagName("input")
If UCase(inp.Title) = UCase("Publication Number") Then
Application.Wait Now + TimeValue("00:00:01")
inp.Focus
inp.Click
Exit For
End If
Next inp
Else
For Each inp In a.document.getElementsByTagName("input")
If UCase(inp.Title) = UCase("Patent Number") Then
Application.Wait Now + TimeValue("00:00:01")
inp.Focus
inp.Click
Exit For
End If
Next inp
End If
Application.Wait Now + TimeValue("00:00:02")
a.document.getElementById("number_id").Value = OnlyPatNum
Application.Wait Now + TimeValue("00:00:02")
a.document.getElementById("SubmitPAIR").Click
Application.Wait Now + TimeValue("00:00:02")
Do Until a.readyState = READYSTATE_COMPLETE
DoEvents
Loop
Application.Wait Now + TimeValue("00:00:10")
Set IEelement = a.document.getElementById("bibview")
MsgBox IEelement.innerText
End Sub
I'am getting error in the line of code.
a.document.getElementById("number_id").Value = OnlyPatNum
I will appreciate if anyone will help.