Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default How to access certain website log in with user name and password andclick certain button?

Hi,
I have new project related to VBA. I search google and found many
solution but doesn't work. The project is to access specific website
log in with user name and password and later click specific button to
get some info.
Please help if you the coding in vba. Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 236
Default How to access certain website log in with user name and passwordand click certain button?

Check this link out:
http://www.mrexcel.com/forum/showthread.php?t=302438

Something to get you started:

In your VBA set refference to:
Microsoft Internet controls

Then use some code along these lines - it's not complete for you -
you'll need to finish it up yourself but it can get you started.

Option Explicit

Sub ClcikMyButton()
Dim ie As SHDocVw.InternetExplorer
Dim hDoc As MSHTML.HTMLDocument

Set ie = New SHDocVw.InternetExplorer

With ie
.Visible = True

Do Until Not ie.Busy And ie.ReadyState = 4
DoEvents
Loop

.Navigate "http://www.google.com"'<--put your url here

'wait until IE finished loading the page
Do Until Not ie.Busy And ie.ReadyState = 4
DoEvents
Loop

End With

Set hDoc = ie.Document


'In some web browser find the ELEMENT_IDs of the textboxes, buttons
of the URL of your interest.
'If they don't have IDs - you'll need to figure out a different way
of accessing those html elements.
With hDoc
.getElementById("PutYourUserNameELEMENT_ID_here"). Value =
"YourUserName"
.getElementById("PutYourPWDELEMENT_ID_here").Value = "YourPWD"
.getElementById("PutYourLogonButtonELEMENT_ID_here ").Click'This
can be done alsy with form.subbmit - depending on the website.
End With


'put here some code to navigate to your url where the button to click
is
'put here some code to click on the button

End Sub

On Jan 4, 2:00*pm, geniusideas wrote:
Hi,
I have new project related to VBA. I search google and found many
solution but doesn't work. The project is to access specific website
log in with user name and password and later click specific button to
get some info.
Please help if you the coding in vba. Thanks


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default How to access certain website log in with user name and passwordand click certain button?

Dear AB,

The above code won't work, unable to load desire website. Totally
hang.
Please help.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 236
Default How to access certain website log in with user name and passwordand click certain button?

So, is it creating the IE object (i.e., does it create an Internet
Explorer window) but fails to load the page that you want it to?

On Jan 5, 3:26*pm, geniusideas wrote:
Dear AB,

The above code won't work, unable to load desire website. Totally
hang.
Please help.


  #5   Report Post  
Posted to microsoft.public.excel.programming
ron ron is offline
external usenet poster
 
Posts: 118
Default How to access certain website log in with user name and passwordand click certain button?

On Jan 5, 8:26*am, geniusideas wrote:
Dear AB,

The above code won't work, unable to load desire website. Totally
hang.
Please help.


What's the website url?..Ron


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default How to access certain website log in with user name and passwordand click certain button?

On Jan 5, 11:55*pm, AB wrote:
So, is it creating the IE object (i.e., does it create an Internet
Explorer window) but fails to load the page that you want it to?

On Jan 5, 3:26*pm, geniusideas wrote:

Dear AB,


The above code won't work, unable to load desire website. Totally
hang.
Please help.


yes, fail to load page but create internet explorer window
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default How to access certain website log in with user name and passwordand click certain button?

On Jan 6, 12:39*am, ron wrote:
On Jan 5, 8:26*am, geniusideas wrote:

Dear AB,


The above code won't work, unable to load desire website. Totally
hang.
Please help.


What's the website url?..Ron


Any web also cannot, even u try google..
  #8   Report Post  
Posted to microsoft.public.excel.programming
ron ron is offline
external usenet poster
 
Posts: 118
Default How to access certain website log in with user name and passwordand click certain button?

On Jan 7, 7:51*am, geniusideas wrote:
On Jan 6, 12:39*am, ron wrote:

On Jan 5, 8:26*am, geniusideas wrote:


Dear AB,


The above code won't work, unable to load desire website. Totally
hang.
Please help.


What's the website url?..Ron


Any web also cannot, even u try google..


This works for Google log-in...Ron

Sub IE_Automation()

' Open the Google log-in web page
my_url = "https://www.google.com/accounts/ServiceLogin?
continue=http://www.google.com/ig% _
3Ftab%3Dgw%26hl%3Den&followup=http://www.google.com/
ig%3Ftab%3Dgw%26 _
hl
%3Den&service=ig&passive=true&cd=US&hl=en&nui=1&lt mpl=default"

Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = True
.Navigate my_url
End With

' Loop until the page is fully loaded
Do Until ie.ReadyState = 4 And Not ie.Busy
DoEvents
Loop

' Log-in
Set ipf = ie.Document.all.Item("Email")
ipf.Value = "your e-mail address"

Set ipf = ie.Document.all.Item("Passwd")
ipf.Value = "your Google password"

Set ipf = ie.Document.getElementByID("signIn")
ipf.Click

' Loop until the page is fully loaded
Do Until ie.ReadyState = 4 And Not ie.Busy
DoEvents
Loop

' Now do whatever

End Sub

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
Going to website & Entering username & password [email protected] Excel Programming 3 June 28th 10 03:48 PM
ADO / Excel & Access: User ID and Password Santiago[_2_] Excel Programming 0 August 5th 05 09:22 PM
User name button access. sungen99[_23_] Excel Programming 2 August 4th 05 09:15 PM
Password on Website Mohammed Wadood Excel Programming 0 December 23rd 04 05:36 PM
User name & password access to Excel files in a folder Maria[_6_] Excel Programming 4 November 17th 03 06:44 PM


All times are GMT +1. The time now is 06:10 PM.

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

About Us

"It's about Microsoft Excel"