0

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

1 Answer 1

1

Is it perhaps as simple as adding a 'set'?

set a = html.getElementById("")
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.