I am trying to set up a way to log into website similar to logging into Gmail using Excel 2010. After enabling Microsoft HTML Object Library and Microsoft Internet Controls through the Tools > Reference menu in VB and then using the code below I've gotten as far as navigating to the page and filling in the filed. Where I am stuck is on is click the submit button. After getting past the login screen I then need to be able to navigate to another page. Also, if there is a cookie dropped on login that prevents having to login again I would like a way to check to see if I am logged in and then move onto the next step of navigating to the next page. Any help would be greatly appreciated.
Dim HTMLDoc As HTMLDocument
Dim oBrowser As InternetExplorer
Dim oHTML_Element As IHTMLElement
Dim sURL As String
On Error GoTo Err_Clear
sURL = "https://gmail.com"
Set oBrowser = New InternetExplorer
oBrowser.Silent = True
oBrowser.timeout = 60
oBrowser.Visible = True
' Wait till the Browser is loaded
Loop Until oBrowser.readyState = READYSTATE_COMPLETE
Set HTMLDoc = oBrowser.document
HTMLDoc.all.Email.Value = "username"
HTMLDoc.all.Passwd.Value = "password"
For Each oHTML_Element In HTMLDoc.getElementsByTagName("input")
' oBrowser.Refresh ' Refresh If Needed
If Err <> 0 Then