Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Logging onto a website
Is it possible in a macro to go to a website (URL in say A1) and to
pass parameters like login name (in A2) and password (in A3), so that you could automatically log in to that website? If so, is it then possible to simulate mouse-clicks on subsequent pages, so that you could choose from options to get further into the site? Option choices could be listed in A4, A5 etc. so I could set this up for a variety of clients. Ultimately, what I would like to do is to print off a page (which might be an HTML page, but is sometimes shown in a PDF viewer) automatically. The page is a copy invoice for my client(s), and currently I have to log on to the supplier's website, then maybe select the client from a list, maybe select "View Invoices" from another list, and ultimately select the appropriate invoice from another list (usually in reverse date order). All of this takes a considerable amount of time just to get a paper copy (which used to be mailed to me, but suppliers now seem to prefer to give you web access to the invoices), so I'd be grateful if I can speed this process up. Pete |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Logging onto a website
It is possible, I have done it lotes of times. In one case I went to over 2200 webpages and collected the data onto a single spreadsheet. I you give me the URL (not the password nor user account) I can gert you started. -- joel ------------------------------------------------------------------------ joel's Profile: 229 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=161675 Microsoft Office Help |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Logging onto a website
Hi Joel,
thanks for offering to help. Here's one URL that I use: https://business.npower.com/myaccount/login.aspx This is for npower (an electricity supplier). If you would prefer to do this off-line, you can email me at: pashurst <at auditel.net Hope this helps. Pete On Dec 11, 2:46*pm, joel wrote: It is possible, *I have done it lotes of times. *In one case I went to over 2200 webpages and collected the data onto a single spreadsheet. I you give me the URL (not the password nor user account) I can gert you started. -- joel ------------------------------------------------------------------------ joel's Profile: 229 View this thread:http://www.thecodecage.com/forumz/sh...d.php?t=161675 Microsoft Office Help |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Logging onto a website
Below is the login for the N Power Website. Change the UserName and Password as required. It took me a long time to learn all the ticks of downloading webpages into excel. If you do a google search for the string below you will find lots of my examples from Microsoft and TheCodeCage Postings. Joel Excel VBA IE Sub NPowerLogin() MyUserName = "UserName" MyPassword = "Password" URL = "https://business.npower.com/myaccount/login.aspx" Set IE = CreateObject("InternetExplorer.Application") IE.Visible = True 'get web page IE.Navigate2 URL Do While IE.readystate < 4 Or _ IE.busy = True DoEvents Loop Set UserName = IE.document.getelementbyid("txtUsername") 'check if already login, Username object wouldn't exist if loggin If Not UserName Is Nothing Then UserName.Value = MyUserName Set Password = IE.document.getelementbyid("txtPassword") Password.Value = MyPassword Set Form = IE.document.getelementsbytagname("Form") Form(0).submit 'wait for login Do While IE.readystate < 4 Or _ IE.busy = True DoEvents Loop MsgBox ("Logged In") End If IE.Quit End Sub -- joel ------------------------------------------------------------------------ joel's Profile: 229 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=161675 Microsoft Office Help |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Logging onto a website
Thanks for that, Joel.
It's a bit too late to try it now, but I'll have a go tomorrow, as well as searching for some of your other examples. Cheers, Pete On Dec 11, 8:13*pm, joel wrote: Below is the login for the N Power Website. *Change the UserName and Password as required. *It took me a long time to learn all the ticks of downloading webpages into excel. *If you do a google search for the string below you will find lots of my examples from Microsoft and TheCodeCage Postings. Joel Excel VBA IE Sub NPowerLogin() MyUserName = "UserName" MyPassword = "Password" URL = "https://business.npower.com/myaccount/login.aspx" Set IE = CreateObject("InternetExplorer.Application") IE.Visible = True 'get web page IE.Navigate2 URL Do While IE.readystate < 4 Or _ IE.busy = True DoEvents Loop Set UserName = IE.document.getelementbyid("txtUsername") 'check if already login, Username object wouldn't exist if loggin If Not UserName Is Nothing Then UserName.Value = MyUserName Set Password = IE.document.getelementbyid("txtPassword") Password.Value = MyPassword Set Form = IE.document.getelementsbytagname("Form") Form(0).submit 'wait for login Do While IE.readystate < 4 Or _ IE.busy = True DoEvents Loop MsgBox ("Logged In") End If IE.Quit End Sub -- joel ------------------------------------------------------------------------ joel's Profile: 229 View this thread:http://www.thecodecage.com/forumz/sh...d.php?t=161675 Microsoft Office Help |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Logging changes | Excel Discussion (Misc queries) | |||
inporting data from website where website address frequently chang | Excel Programming | |||
Logging a website information. | Excel Worksheet Functions | |||
logging out | Excel Programming | |||
Logging into a website | Excel Discussion (Misc queries) |