Connect Google Mail Account
Sub LoginToGoogleMail()
Set GSH = ThisWorkbook.Sheets("GMail Login")
GMail = GSH.Range("C3").Value
PWD = GSH.Range("C4").Value
Set ie = New InternetExplorer
ie.Visible = True
ie.navigate "https://accounts.google.com"
Application.Wait Now + TimeSerial(0, 0, 3)
Set FirstPage = ie.document
If FirstPage.all.Item(ElementNumber).innerText = GMail Then
FirstPage.all.Item(ElementNumber).Click
Application.Wait Now + TimeSerial(0, 0, 3)
MailIDIdentified = "Yes"
Exit For
End If
Next
FirstPage.getElementById("identifierId").Value = GMail
FirstPage.getElementById("identifierNext").Click
Application.Wait Now + TimeSerial(0, 0, 3)
End If
Set PwdPage = ie.document
For Each InputElement In PwdPage.getElementsByTagName("input")
If InputElement.Name = "password" Then
InputElement.Value = PWD
Exit For
End If
Next
Application.Wait Now + TimeSerial(0, 0, 3)
Application.Wait Now + TimeSerial(0, 0, 3)
End Sub