Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,856
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,856
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,856
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Logging changes SPISO Excel Discussion (Misc queries) 0 May 12th 09 05:44 PM
inporting data from website where website address frequently chang HP Excel Programming 3 June 24th 07 03:50 PM
Logging a website information. Nneuromancer Excel Worksheet Functions 0 August 18th 06 01:19 PM
logging out Tom Excel Programming 0 August 2nd 06 10:45 PM
Logging into a website Jackblack1 Excel Discussion (Misc queries) 0 May 31st 06 05:27 PM


All times are GMT +1. The time now is 02:19 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"