Click here to Skip to main content
15,891,687 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hello,

I am developing one Crawler but facing issue -
I have below code
VB
Sub GetData()
Dim IE As New InternetExplorer
Dim wks As Worksheet

Set wks = ActiveWorkbook.Sheets("Start")

    IE.Visible = True
    'ie.Navigate wks.Range("E4").Value
    IE.Navigate wks.Range("E5").Value

    Do While IE.Busy = True
        Delay 5
    Loop

IE.Document.getElementById("username").Value = wks.Range("E7").Value
IE.Document.getElementById("password").Value = wks.Range("E8").Value

  Set objCollection = IE.Document.getElementsByTagName("input")
    i = 0
    While i < objCollection.Length
            If objCollection(i).Type = "submit" Then
                ' "Submit" button is found
                Set objElement = objCollection(i)
        End If
        i = i + 1
    Wend
    objElement.Click    ' click button to Login

   Do While IE.Busy = True
        Delay 5
    Loop

IE.Document.getElementById("projectCode").innerHTML = "ABC_0012"

End Sub



I am getting error at Last line "innerHTML" as "
object variable or with block variable not set
"

I have also tryied
C#
IE.Document.getElementById(&quot;projectCode&quot;).Value = &quot;ABC_0012&quot;


But facing same issue.
Please help.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900