Here is a code snippet I created for logins. Notice that the main doc loading does not guarantee that all of the frames have finished loading.
Code:
Dim strAddress As String
Dim appInternet As InternetExplorer
Dim HTMLdoc As HTMLDocument
strAddress = "http://www.SomeWebsite.com/login"
Set appInternet = CreateObject("InternetExplorer.Application")
With appInternet
.navigate strAddress
.Visible = True
While .ReadyState <> 4 Or .Busy = True: Wend
Set HTMLdoc = .Document
End With
Dim docFrame1 As HTMLDocument
Set docFrame1 = HTMLdoc.frames(2).Document
While docFrame1.ReadyState <> 4 Or .Busy = True: Wend
docFrame1.getElementById("logInName").Value = "Login"
docFrame1.getElementById("password").Value = "Pass"
docFrame1.Forms(0).submit