Hi,
I am trying to fill a text box on a web page with discouraging results.
When I try to trun the code below, I get a Run time error '91' - "Object Variable or With Block Variable not set" and when I click 'Debug', the last line of code (with "Hello" in it) is highlighted.
This is not the complete code, just the important bit. The website loads fine, but when it gets to the entering data part, the error crops up. Can anyone tell me where I'm going wrong?
Thanks,
H
I am trying to fill a text box on a web page with discouraging results.
When I try to trun the code below, I get a Run time error '91' - "Object Variable or With Block Variable not set" and when I click 'Debug', the last line of code (with "Hello" in it) is highlighted.
Code:
Sub Fill_Website_Textbox()
Dim objIE As SHDocVw.InternetExplorer
Dim OrgBox As HTMLInputElement
Set objIE = New SHDocVw.InternetExplorer
objIE.Navigate "My Website"
objIE.Visible = True
WaitReady 'Sub to wait while internet loads
Set OrgBox = objIE.Document.getElementById("ctl00_MainContent_TabContainer_ProjectInformationPanel_ProjectListView_ctrl0_websiteTextBox")
[COLOR=red]OrgBox.Value = "Hello"[/COLOR]
End Sub
This is not the complete code, just the important bit. The website loads fine, but when it gets to the entering data part, the error crops up. Can anyone tell me where I'm going wrong?
Thanks,
H