VBA code returning Object Required error, unsure of what is causing it

115 Views Asked by At

Having some issues with my code, I've removed the URL since it requires specific access. I have confirmed the ID is correct and copy/pasted rather than manual typing. My code does open up IE, opens the correct URL, but does not paste "test" into the description box. What have I done wrong? I've bolded the line that returns the error.

Sub Test1()
    Dim IE As Object
    Dim doc As HTMLDocument
    Set IE = CreateObject("InternetExplorer.Application")

    IE.Visible = True
    Url = "website"

    With IE
        .navigate Url
        .Visible = True
        'Waiting till page loads
        Do While .readyState <> READYSTATE_COMPLETE
            DoEvents
            Debug.Print "Waiting on IE" & Time
        Loop

    End With
    
    Application.Wait (Now + TimeValue("00:00:08"))
    
    **IE.document.getElementById("new_call.description").Value = "test"**
End Sub
0

There are 0 best solutions below