Hi All,
I am trying to automate IE from excel VBA.
I have a form in the webpage with id "frmIDSSTUSearch" and a text box inside the form with id "txtSTUno", i have to pass a value to that textbox from my excel macro.
I want to enter 401 in the text box present in the webpage, this is what i m trying with. THis gives an error "Object variable or withblock variable not set.
IE.Document.all.forms ("frmIDSSTUSearch.txtSTUno").Value = "401"
can someone help me?
real code
Sub Search_Student()
Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
IE.Navigate "http:www.studentsearch.com"
IE.Visible = True
While IE.Busy
DoEvents 'wait until IE is done loading page.
Wend
IE.Document.all.forms ("frmIDSSTUSearch.txtSTUno").Value = "401"
While IE.Busy
DoEvents 'wait until IE is done loading page.
Wend
End Sub