I keep getting "object variable or with block variable not set" error when running the below VBA. All i am trying to do is return a = html.getElementById("") but keep getting an error on that line. I have removed everything between "" as they are sensitive details.. Cheers in advance
Sub web_scrape()
Dim IEobject As InternetExplorer
Dim a As Variant
Set IEobject = New InternetExplorer
IEobject.Visible = True
IEobject.navigate Url:=("website.url")
Do While IEobject.Busy = True Or IEobject.readyState <> READYSTATE_COMPLETE
Application.Wait Now + TimeValue("00:00:01")
Loop
Dim html As HTMLDocument
Set html = IEobject.document
html.getElementById("AuthUC$txtUserID").Value = ("")
html.getElementById("AuthUC_txtData").Value = ("")
html.getElementById("AuthUC_btnLogin").Click
a = html.getElementById("")
End Sub