Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ana Ana is offline
external usenet poster
 
Posts: 44
Default automate excel to login web pages

Hi,

I would like to know if anyone has a solution to log in into a web page that
requires a user name and a password from a macro.
I tried diferent codes from internet without any result

Is it possible to do it with a web query ?
I have just need to log to
https://www.bernstein.com/Reports/Su...relid=94565692

and then copy a table with values

Is it posible to copy the values from a table form i.explorer to excel or
shall I save the page first and then open it with excel?

any ideas?

thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 897
Default automate excel to login web pages

I have some sample code on my site:

http://www.codeforexcelandoutlook.co...tExplorer.html


HTH,
JP

On Apr 14, 10:45*am, Ana wrote:
Hi,

I would like to know if anyone has a solution to log in into a web page that
requires a user name and a password from a macro.
I tried diferent codes from internet without any result

Is it possible to do it *with a web query ?
I have just need to log tohttps://www.bernstein.com/Reports/Summary.aspx?nid=108&relid=94565692

and then copy a table with values

Is it posible to copy the values from a table form i.explorer to excel or
shall I save the page first and then open it with excel?

any ideas?

thanks


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default automate excel to login web pages

Try this:

Sub test()
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = True
.Navigate "https://www.bernstein.com/login.aspx?ReturnUrl=" & _
"%2fReports%2fSummary.aspx%3fnid%" & _
"3d108%26relid%3d94565692&nid=108&relid=945656 92"
Do Until .ReadyState = 4
DoEvents
Loop
Set ipf = .Document.all.Item("UserName")
ipf.Value = "username"
Set ipf = .Document.all.Item("Password")
ipf.Value = "password"
SendKeys "{ENTER}", True
End With
End Sub

--
Dan


On Apr 14, 9:45*am, Ana wrote:
Hi,

I would like to know if anyone has a solution to log in into a web page that
requires a user name and a password from a macro.
I tried diferent codes from internet without any result

Is it possible to do it *with a web query ?
I have just need to log tohttps://www.bernstein.com/Reports/Summary.aspx?nid=108&relid=94565692

and then copy a table with values

Is it posible to copy the values from a table form i.explorer to excel or
shall I save the page first and then open it with excel?

any ideas?

thanks

  #4   Report Post  
Posted to microsoft.public.excel.programming
Ana Ana is offline
external usenet poster
 
Posts: 44
Default automate excel to login web pages

Thanks for your help I tried your code , I am able to open de page, write the
user and the password but nothing else. It does not log in with the
information.

That is the same problem with all the code I tried I am not able to " clic
in the log in button "

Any idea?
thanks again


"JP" wrote:

I have some sample code on my site:

http://www.codeforexcelandoutlook.co...tExplorer.html


HTH,
JP

On Apr 14, 10:45 am, Ana wrote:
Hi,

I would like to know if anyone has a solution to log in into a web page that
requires a user name and a password from a macro.
I tried diferent codes from internet without any result

Is it possible to do it with a web query ?
I have just need to log tohttps://www.bernstein.com/Reports/Summary.aspx?nid=108&relid=94565692

and then copy a table with values

Is it posible to copy the values from a table form i.explorer to excel or
shall I save the page first and then open it with excel?

any ideas?

thanks



  #5   Report Post  
Posted to microsoft.public.excel.programming
Ana Ana is offline
external usenet poster
 
Posts: 44
Default automate excel to login web pages

Thanks for your help,

I tried your but I still have the same problem I can open de page, write the
user and the password but nothing else. I can not log in.

SendKeys "{ENTER}", True

does not work for me but If I do it manually on the page it works with enter

any suggestions?

thanks again


Any idea?
thanks again

"Dan R." wrote:

Try this:

Sub test()
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = True
.Navigate "https://www.bernstein.com/login.aspx?ReturnUrl=" & _
"%2fReports%2fSummary.aspx%3fnid%" & _
"3d108%26relid%3d94565692&nid=108&relid=945656 92"
Do Until .ReadyState = 4
DoEvents
Loop
Set ipf = .Document.all.Item("UserName")
ipf.Value = "username"
Set ipf = .Document.all.Item("Password")
ipf.Value = "password"
SendKeys "{ENTER}", True
End With
End Sub

--
Dan


On Apr 14, 9:45 am, Ana wrote:
Hi,

I would like to know if anyone has a solution to log in into a web page that
requires a user name and a password from a macro.
I tried diferent codes from internet without any result

Is it possible to do it with a web query ?
I have just need to log tohttps://www.bernstein.com/Reports/Summary.aspx?nid=108&relid=94565692

and then copy a table with values

Is it posible to copy the values from a table form i.explorer to excel or
shall I save the page first and then open it with excel?

any ideas?

thanks




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default automate excel to login web pages

Try this one:

Sub test()
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = True
.Navigate "https://www.bernstein.com/login.aspx?ReturnUrl=" & _
"%2fReports%2fSummary.aspx%3fnid%" & _
"3d108%26relid%3d94565692&nid=108&relid=945656 92"
Do Until .ReadyState = 4
DoEvents
Loop
Set ipf = .Document.all.Item("UserName")
ipf.Value = "username"
Set ipf = .Document.all.Item("Password")
ipf.Value = "password"
Set ipf = .Document.all.Item("LoginButton")
Do Until .ReadyState = 4
DoEvents
Loop
ipf.Click
End With
End Sub

--
Dan


On Apr 15, 8:18*am, Ana wrote:
Thanks for your help,

I tried your but I still have the same problem I can open de page, write the
user and the password but nothing else. *I can not log in.

SendKeys "{ENTER}", True *

does not work for me but If I do it manually on the page it works with enter

any suggestions?

thanks again

Any idea?
thanks again



"Dan R." wrote:
Try this:


Sub test()
* Set ie = CreateObject("InternetExplorer.Application")
* With ie
* * .Visible = True
* * .Navigate "https://www.bernstein.com/login.aspx?ReturnUrl=" & _
* * * * * * "%2fReports%2fSummary.aspx%3fnid%" & _
* * * * * * "3d108%26relid%3d94565692&nid=108&relid=945656 92"
* * Do Until .ReadyState = 4
* * * DoEvents
* * Loop
* * Set ipf = .Document.all.Item("UserName")
* * ipf.Value = "username"
* * Set ipf = .Document.all.Item("Password")
* * ipf.Value = "password"
* * SendKeys "{ENTER}", True
* End With
End Sub


--
Dan


On Apr 14, 9:45 am, Ana wrote:
Hi,


I would like to know if anyone has a solution to log in into a web page that
requires a user name and a password from a macro.
I tried diferent codes from internet without any result


Is it possible to do it *with a web query ?
I have just need to log tohttps://www.bernstein.com/Reports/Summary.aspx?nid=108&relid=94565692


and then copy a table with values


Is it posible to copy the values from a table form i.explorer to excel or
shall I save the page first and then open it with excel?


any ideas?


thanks- Hide quoted text -


- Show quoted text -

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 897
Default automate excel to login web pages

Using the sample code from my site, it would be

Set ElementCol = appIE.Document.getElementsByTagName("INPUT")

For Each btnInput In ElementCol
If btnInput.Id = "LoginButton" Then
btnInput.Click
Exit For
End If
Next btnInput

And I believe the code in Dan's last post would work as well.

--JP

On Apr 15, 9:13*am, Ana wrote:
Thanks for your help I tried your code , I am able to open de page, write the
user and the password but nothing else. It does not log in with the
information.

That is the same problem with all the code I tried *I am not able to " clic
in the log in *button "

Any idea?
thanks again



  #8   Report Post  
Posted to microsoft.public.excel.programming
Ana Ana is offline
external usenet poster
 
Posts: 44
Default automate excel to login web pages

Hi,
I have just tried your code and it works thank you a lot :o))))))))



"Dan R." wrote:

Try this one:

Sub test()
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = True
.Navigate "https://www.bernstein.com/login.aspx?ReturnUrl=" & _
"%2fReports%2fSummary.aspx%3fnid%" & _
"3d108%26relid%3d94565692&nid=108&relid=945656 92"
Do Until .ReadyState = 4
DoEvents
Loop
Set ipf = .Document.all.Item("UserName")
ipf.Value = "username"
Set ipf = .Document.all.Item("Password")
ipf.Value = "password"
Set ipf = .Document.all.Item("LoginButton")
Do Until .ReadyState = 4
DoEvents
Loop
ipf.Click
End With
End Sub

--
Dan


On Apr 15, 8:18 am, Ana wrote:
Thanks for your help,

I tried your but I still have the same problem I can open de page, write the
user and the password but nothing else. I can not log in.

SendKeys "{ENTER}", True

does not work for me but If I do it manually on the page it works with enter

any suggestions?

thanks again

Any idea?
thanks again



"Dan R." wrote:
Try this:


Sub test()
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = True
.Navigate "https://www.bernstein.com/login.aspx?ReturnUrl=" & _
"%2fReports%2fSummary.aspx%3fnid%" & _
"3d108%26relid%3d94565692&nid=108&relid=945656 92"
Do Until .ReadyState = 4
DoEvents
Loop
Set ipf = .Document.all.Item("UserName")
ipf.Value = "username"
Set ipf = .Document.all.Item("Password")
ipf.Value = "password"
SendKeys "{ENTER}", True
End With
End Sub


--
Dan


On Apr 14, 9:45 am, Ana wrote:
Hi,


I would like to know if anyone has a solution to log in into a web page that
requires a user name and a password from a macro.
I tried diferent codes from internet without any result


Is it possible to do it with a web query ?
I have just need to log tohttps://www.bernstein.com/Reports/Summary.aspx?nid=108&relid=94565692


and then copy a table with values


Is it posible to copy the values from a table form i.explorer to excel or
shall I save the page first and then open it with excel?


any ideas?


thanks- Hide quoted text -


- Show quoted text -


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 897
Default automate excel to login web pages

Glad to hear it!

Thx,
JP

On Apr 22, 11:11*am, Ana wrote:
Hi,
I have just tried your code and it works thank you a lot :o))))))))



  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default automate excel to login web pages

Guys,

I'm trying to do something similar to what Ana was trying to do, the only
difference is that when I go to access the secured website I need, I need to
fill out the user id and password in a separate window that pops up... Any
suggestions on how I can tweak your pieces of code in order to fill out the
id & pwd in this separate window instead of the main window?

Thanks.

"JP" wrote:

Glad to hear it!

Thx,
JP

On Apr 22, 11:11 am, Ana wrote:
Hi,
I have just tried your code and it works thank you a lot :o))))))))






  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 897
Default automate excel to login web pages

If it's one of those modeless/emnuless dialog boxes, you probably
won't be able to use these techniques to access that website.

--JP


On Jun 27, 2:12*pm, avardaneg
wrote:
Guys,

I'm trying to do something similar to what Ana was trying to do, the only
difference is that when I go to access the secured website I need, I need to
fill out the user id and password in a separate window that pops up... Any
suggestions on how I can tweak your pieces of code in order to fill out the
id & pwd in this separate window instead of the main window?

Thanks.



  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default automate excel to login web pages

I see...
How about if I use "SendKeys" to send the ID+PWD information to the dialog
box?
Would that work?

"JP" wrote:

If it's one of those modeless/emnuless dialog boxes, you probably
won't be able to use these techniques to access that website.

--JP


On Jun 27, 2:12 pm, avardaneg
wrote:
Guys,

I'm trying to do something similar to what Ana was trying to do, the only
difference is that when I go to access the secured website I need, I need to
fill out the user id and password in a separate window that pops up... Any
suggestions on how I can tweak your pieces of code in order to fill out the
id & pwd in this separate window instead of the main window?

Thanks.




  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 897
Default automate excel to login web pages

Oops I misspelled "menuless" LOL

Sendkeys might work, but it's not ideal. You probably want to bake
some "Application.Wait" calls to make sure the dialog box is fully
loaded before using that option.

i.e.

Application.Wait Now + TimeValue("00:00:01")

to add one second to the macro processing time.

Also you probably want to add some code that checks to make sure the
sendkeys was successful (i.e. look for an element on the next page
that would only appear if you actually made it to the next page).

--JP


On Jun 27, 3:05*pm, avardaneg
wrote:
I see...
How about if I use "SendKeys" to send the ID+PWD information to the dialog
box?
Would that work?



"JP" wrote:
If it's one of those modeless/emnuless dialog boxes, you probably
won't be able to use these techniques to access that website.


--JP


On Jun 27, 2:12 pm, avardaneg
wrote:
Guys,


I'm trying to do something similar to what Ana was trying to do, the only
difference is that when I go to access the secured website I need, I need to
fill out the user id and password in a separate window that pops up.... Any
suggestions on how I can tweak your pieces of code in order to fill out the
id & pwd in this separate window instead of the main window?


Thanks.- Hide quoted text -


- Show quoted text -


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
How do I delete pages in Excel? Keeps printing blank pages at end. Jojobean Charts and Charting in Excel 1 May 31st 07 07:37 AM
Need Help -- Baseball stats in excel only has 23 pages--Need to addmore pages.. GE Cathey Setting up and Configuration of Excel 7 May 17th 07 09:42 PM
Need Help -- Baseball stats in excel only has 23 pages--Need to addmore pages... GE Cathey Excel Worksheet Functions 1 May 16th 07 08:17 PM
Automate moving between pages on a pivot table Meryl Miller Excel Programming 2 February 3rd 06 12:27 AM
How to automate web login? RB Smissaert Excel Programming 0 September 27th 05 07:19 PM


All times are GMT +1. The time now is 01:56 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"