Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatically Fill in fields in IE w/ VBScript

Status
Not open for further replies.

lyric0n

Technical User
Joined
Dec 28, 2005
Messages
74
I know how to have VBScript open IE and navigate to a specific page, but I am having problems controlling the fields because they do not have id tags associated with the fields. The page I am looking at is...


I need to fill in the Username, Password and then click the login button.

If anyone has any ideas, I would appreciate it, thanks,
Chris
 
Let oie be the IWebBrowser(2) instantiated and navigated to the page in question. As to the page, its forms, totally 3, has not been assigned a name that you should assign, I would use the index herein, though, for illustration.

Suppose you want to submit the account login form (the 3rd) form, you can do this. (uncomment the line to submit).
[tt]
with oie.document.forms(2)
.username.value="abc"
.password.value="#3c!1a@2b"
[blue]'[/blue].submit
end with
[/tt]
 
I can't seem to get this working...I've tried a few different things, but doesn't seem to be going. Here is my code...it bails right on the like "With..." and gives the error 80004005. :-/


Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate "
With IE.Document.Forms(2)
.username.value="abc"
.password.value="123"
.submit
End With
 
And what about this ?
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate "Set F=IE.Document.Forms(2)
F.username.value="abc"
F.password.value="123"
F.submit


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Unfortunately, getting the same failure... I am using IE6 SP2 if that means anything...
 
And this ?
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate "Do While IE.Busy
WScript.Sleep 500
Loop
Set F=IE.Document.Forms(2)
F.username.value="abc"
F.password.value="123"
F.submit

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
*Bangs head on table*
That wait would case the issue wouldn't it...thank you...it was a long weekend...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top