ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   automate excel to login web pages (https://www.excelbanter.com/excel-programming/409327-automate-excel-login-web-pages.html)

Ana

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


JP[_4_]

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



Dan R.

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


Ana

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




Ana

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



Dan R.

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 -


JP[_4_]

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




Ana

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 -



JP[_4_]

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))))))))




avardaneg

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))))))))





JP[_4_]

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.




avardaneg

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.





JP[_4_]

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 -




All times are GMT +1. The time now is 08:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com