Hi All,
Gmail is not using one page format log in anymore so the macro for one page format log in is not valid for log in purpose.
I try to modify the code below for page by page step log in, but only success for input email address and then no further action afterwards.
Any idea what wrong with the code for input the password?
Regards,
Benny
Gmail is not using one page format log in anymore so the macro for one page format log in is not valid for log in purpose.
I try to modify the code below for page by page step log in, but only success for input email address and then no further action afterwards.
Code:
Dim HTMLDoc As HTMLDocument
Dim oBrowser As InternetExplorer
Sub NewGmailLogin()
Dim oHTML_Element As IHTMLElement
Dim sURL As String
On Error GoTo Err_Clear
sURL = "https://accounts.google.com/ServiceLogin?service=mail&passive=true&rm=false&continue=https://mail.google.com/mail/&ss=1&scc=1<mpl=default<mplcache=2&emr=1&osid=1#"
Set oBrowser = New InternetExplorer
oBrowser.Silent = True
oBrowser.TimeOut = 60
oBrowser.navigate sURL
oBrowser.Visible = True
Do
' Wait till the Browser is loaded
Loop Until oBrowser.readyState = READYSTATE_COMPLETE
Set HTMLDoc = oBrowser.document
HTMLDoc.all.Email.Value = "my@gmail.com"
For Each oHTML_Element In HTMLDoc.getElementsByTagName("input")
If oHTML_Element.Type = "submit" Then oHTML_Element.Click: Exit For
Next
Do
' Wait till the Browser is loaded
Loop Until oBrowser.readyState = READYSTATE_COMPLETE
HTMLDoc.all.Passwd.Value = "mypassword"
For Each oHTML_Element In HTMLDoc.getElementsByTagName("input")
If oHTML_Element.Type = "submit" Then oHTML_Element.Click: Exit For
Next
' oBrowser.Refresh ' Refresh If Needed
Err_Clear:
If Err <> 0 Then
'Debug.Assert Err = 0
Err.Clear
Resume Next
End If
End Sub
Any idea what wrong with the code for input the password?
Regards,
Benny