Here's an example of a way to login automatically. Each website is going to
be different, with different forms and names--the trick is to match the form
names with what they do and then utilize their properties to enter
information in the right spots and click the right button. This procedure
lists the name of each form, which is a good way to start, as the names give
a good idea of what the form does. And then it logs you in to the Yahoo
Message boards server.
HTH,
Shockley
Sub Login()
sURL =
"
http://edit.my.yahoo.com/config/login?.src=mb&.done=http://messages.yahoo
..com/bbs%3f.mm=FN%26action=r%26board=4687440%26tid=ener%26sid=4687440%26mid=
0&lg=us&.intl=us"
Dim IE As New InternetExplorer
IE.navigate sURL
While (IE.Busy)
DoEvents
Wend
Do
On Error Resume Next
Set htm = IE.Document
Err = 0
If Not htm Is Nothing Then Exit Do
Loop
Do
Set frms = htm.forms(0)
If Not frms Is Nothing Then Exit Do
Loop
IE.Visible = True
For i = 1 To frms.Length
Set frm = frms(i - 1)
Cells(i, 1) = frm.Name
Next i
For i = 1 To frms.Length
Set frm = frms(i - 1)
sTest = frm.Name
If sTest = "login" Then
frm.Value = "myusername"
End If
If sTest = "passwd" Then
frm.Value = "mypassword"
End If
If sTest = ".save" Then
frm.Click
End If
Next i
Set oDoc = Nothing
Set IE = Nothing
End Sub