Re: web query w/login and password
From: ron (oitbso_at_yahoo.com)
Date: 04/28/04
- Next message: Ron de Bruin: "Re: Looping though *.xls files except for the main consolidation file"
- Previous message: Frank Kabel: "Macro Loop, Find, and Total"
- In reply to: Fun Kid: "web query w/login and password"
- Next in thread: Fun Kid: "Re: web query w/login and password"
- Reply: Fun Kid: "Re: web query w/login and password"
- Messages sorted by: [ date ] [ thread ]
Date: 28 Apr 2004 08:18:42 -0700
It seems that there are usually several different ways to accomplish
the same goal within Excel. An alternative method to that proposed by
Jake follows:
Sub 401K()
' Prepare to open the web page
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = True
.Navigate "http://www.gwrs.com/"
' Loop until the page is fully loaded
Do Until Not .Busy
DoEvents
Loop
' Make the desired selections on the web page and click the submit
button
Set ipf = ie.document.all.Item("SSN")
ipf.Value = "123456789"
Set ipf = ie.document.all.Item("PIN")
ipf.Value = "abc123"
Set ipf = ie.document.all.Item("btnarrow")
ipf.Value = "submit"
ipf.Click
' Loop until the page is fully loaded
Do Until Not .Busy
DoEvents
Loop
End With
' Select and copy all of the data from the web page
ie.ExecWB OLECMDID_SELECTALL, OLECMDEXECOPT_DONTPROMPTUSER
ie.ExecWB OLECMDID_COPY, OLECMDEXECOPT_DODEFAULT
' Close the internet explorer application
ie.Quit
' Now write code to paste the web page into a worksheet and begin to
' process / extract the information of interest
End Sub
You can usually find the "item names" by viewing the source code for
the web page (right click on the web page and "View Source" is an
option). I can't tell for sure if the above code is error free,
because I don't have a valid PIN. I do know that the above code
correctly enters the SSN and PIN into the login windows and it takes
me to a page that asks for a valid SSN and PIN. So if it doesn't
work, I think it is close...Ron
- Next message: Ron de Bruin: "Re: Looping though *.xls files except for the main consolidation file"
- Previous message: Frank Kabel: "Macro Loop, Find, and Total"
- In reply to: Fun Kid: "web query w/login and password"
- Next in thread: Fun Kid: "Re: web query w/login and password"
- Reply: Fun Kid: "Re: web query w/login and password"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|