Fill out web form with VB

N

Nelson

I am trying to automatically login to a website with Access VB. Here is the
pertenent html code for the page (with identifiable info changed for
security):

<TD class=ftr align=middle>Sign-on with your User ID and Password. Your
password is case sensitive.</TD></TR></TBODY></TABLE>
<TABLE width="80%" align=center bgColor=#efefef>
<TBODY>
<TR>
<TD align=right width="50%"><B>Username:</B></TD>
<TD align=left><INPUT maxLength=10 size=10 name=username></TD></TR>
<TR>
<TD align=right width="50%"><B>Password:</B></TD>
<TD align=left><INPUT type=password maxLength=15 size=10 value=""
name=userpassword></TD></TR>
<TR>
<TD align=middle colSpan=2>
<HR SIZE=2>
<INPUT type=submit value=Login> <BR><BR><A
onclick='window.open("http://www.website.com/docs/cookieuse.htm","",windowFe
atures="height=450,width=600,resizable,scrollbars,alwaysRaised,dependent")'>
<FONT size=-1>Our Use of Cookies</FONT></A>
<BR></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>

This is the code I am using:

Dim Ie As Object

Set Ie = CreateObject("InternetExplorer.Application")
Ie.Navigate "https://secure.freeclaims.com/docs/membermain.asp"
Ie.Visible = True
Do While Ie.Busy
DoEvents
Loop

Ie.Document.All("username").Value = "myname"
Ie.Document.All("userpassword").Value = "xxpasswordxx"
Ie.Document.All("Login").Click '***THIS DOES NOT CLICK THE BUTTON***

Set Ie = Nothing

The correct page comes up in IE, username & userpassword are entered
correctly but the login button is not clicked. What do I need to do to
click the button? Also how do I maximize the IE window?

Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top