PDA

View Full Version : Input Username and Password



lurker2102
04-10-2013, 11:42 AM
Hi, im New with Access VBA. I have a code here that needs to input username and password to a certain site.
Not sure why the objIE.Document.all is not working when trying to input the necessary details. Hope someone can help me with this roadblock. Thanks in advance

Here's my code



Private Sub Command7_Click()

Set objIE = New InternetExplorer

objIE.Visible = True

objIE.Navigate "https://licensing.adobe.com/sap(bD1lbiZjPTAwMw==)/bc/bsp/sap/zavllogin/login.htm?sap-language=EN"

Do While objIE.ReadyState <> READYSTATE_COMPLETE Or objIE.Busy: DoEvents: Loop

objIE.Document.all("username").Value = "username"
objIE.Document.all("password").Value = "adobe123"
objIE.Document.ParentWindow.ExecScript "submitEvent('login');", "JScript"
End Sub

SoftwareMatt
04-24-2013, 07:39 AM
This is the code that works for me:



Set ie = CreateObject("InternetExplorer.application")
strAddress = "https://www.WHATEVER.co.uk"

ie.Visible = True
ie.Navigate strAddress
Do Until ie.ReadyState = 4
Loop

ie.Document.all.Item("emaillogin.Username").Value = "USERNAME"

ie.Document.all.Item("emaillogin.Password").Value = "PASSWORD"

lurker2102
05-03-2013, 12:37 PM
Thanks JD for the reply. Unfortunately, it didn't solved my problem.
I can't input my username and password on their respective textbox.

Hope you can help me to check the reason why it is not working. Thanks!

Regards