Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Login to a web page & automatically fill in pasword
Hi
IE v6.0 This is my 1st attempt at this , so please bear with me. I want to logon to my banks site & get my stock/shares values to add to a worksheet. I need vba to fill in the logon password/ID boxes on the login page for me. I got to get past the first page that requires the passwords etc, but there's a second page with a continue button that's stumped me. It won't accept .click or .submit: This is as far as I've got: the ** line is the problem Have I got the right page/form? Sub LoginSite() Dim oIE As New SHDocVw.InternetExplorer Dim sSearchTerm As String Dim sURL As String sSearchTerm = "programically fill out web form" sURL = '"https://www.mybank.co.uk/frames/login_body.asp" 'open a new, visible IE window Set oIE = New SHDocVw.InternetExplorer oIE.Visible = True 'go to desired page oIE.Navigate sURL 'wait for page to finish loading Do Until oIE.ReadyState = READYSTATE_COMPLETE DoEvents Loop oIE.Document.all("txtCustomerID").Value = "MyID" oIE.Document.all("txtPassnumber").Value = "MyPass" oIE.Document.forms(0).submit Do Until oIE.ReadyState = READYSTATE_COMPLETE DoEvents Loop ' **oIE.Document.forms(0).submit ' This doesn't work either: ' oIE.Document.all("Continue").click End Sub This is the source code (& a bit more I think): <td align="center" valign="bottom" <table width="50%" border="0" cellspacing="0" cellpadding="2" <tr <td class="table-light" align="left" valign="bottom"<a href="/frames/history_reset_redirect.asp?FramesPage=/frames/logoff_body_2.as p" target="_top""<img border="0" src="../pixels/button_logout.gif" alt="Log Out" TITLE="Log Out" NAME="Log Out"</a</td <td class="table-light" align="right" valign="bottom"<a href=" " target="_self"<img src="../pixels/button_continue.gif" border="0" alt="continue" TITLE="Continue" NAME="Continue"</a</td </tr </table </td There doesn't seem to be a help for the IE object model.. is this correct & Is there a way to get Intelisnese to work within the the IDE for this? If there's any other improvements I can make, please feel free to tell me. Hope you can help. Dave F. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Login to a web page & automatically fill in pasword
Hi Dave,
I am trying to do something similar and was on the board looking for solutions... I started with something like this .... it filled in the Username and Password ... my problem is that on the site I am hitting another window opens up which I am trying to figure out how to close so that the focus is returned to the login window. __________________________________________________ _____________________________ Public Sub FillInUserName() Dim brokerAcct As InternetExplorer Dim OBJ As Object Set brokerAcct = New InternetExplorer brokerAcct.Visible = True brokerAcct.Navigate "<<login URL" Do Until brokerAcct.ReadyState = READYSTATE_COMPLETE DoEvents Loop 'Log on Set OBJ = brokerAcct.Document.all.Item("userName") OBJ.Value = "<<USERNAME" Set OBJ = brokerAcct.Document.all.Item("Password") OBJ.Value = "<<PASSWORD" Set OBJ = brokerAcct.Document.all.Item("<<loginform") ifp.Submit brokerAcct.Quit Set brokerAcct = Nothing End Sub __________________________________________________ __________________________ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Hellllllp Can,t remember pasword | Excel Worksheet Functions | |||
can i carryover data automatically from page to page and how? | New Users to Excel | |||
Excell VBA pasword | Excel Discussion (Misc queries) | |||
How do I automatically insert the user (login name) in Excel? | Excel Discussion (Misc queries) | |||
To print multiple selection and how to back VBA module pasword | Excel Programming |