MS Access Forms using VBA to auto login in https URLs

Chuckie

New member
Local time
Today, 16:01
Joined
May 7, 2013
Messages
1
Hello Gurus,

I have a project using MS Access Forms VBA to do auto login into internal secure https URLs.

My source code has NO PROBLEM to pass pamameters to public URLs (http and https) login pages such as google mail or yahoo mail

But just can not do the same for the internal secure URLs at my company. It's not about certificate because after the VBA code can't do auto login then I can manually enter the login info successfully.

After the Internal Login Page loaded then can't passing values into the texboxes or click, so after that then I have to manually enter the values.

The weird thing is this source code works for the same login page for my company, but with http URLs only.

Any has any idea to share will be highly appreciated.

Private Sub button_Click()
Dim mydoc As HTMLDocument
Dim myBrowser As InternetExplorer

Dim myElement As IHTMLElement
Dim myUrl As String, dom As String, log As String, pas As String

On Error GoTo Err_Clear

dom = Me!dom_txt
log = Me!login_txt
pas = Me!Password_txt

myUrl = "h-t-t-p-s Internal Url here"
Set myBrowser = New InternetExplorer
' myBrowser.Silent = True
myBrowser.timeout = 60
myBrowser.navigate myUrl
myBrowser.Visible = True

Do
Loop Until myBrowser.readyState = READYSTATE_COMPLETE

Set mydoc = myBrowser.Document
mydoc.all.NF_CustomerId.Value = dom
mydoc.all.NF_UserName.Value = log
mydoc.all.NF_Password.Value = pas
For Each myElement In mydoc.getElementsByTagName("input")
If myElement.TYPE = "image" Then myElement.Click: Exit For
Next

Err_Clear:
If Err <> 0 Then
Err.Clear
Resume Next
End If
End Sub


Thanks,
Chuck
 
Are you getting any errors? You might want to change your error handler to display the error messages, it might help diagnose the problem with the login.
 

Users who are viewing this thread

Back
Top Bottom