I have this code for now: but I cant sign in to out site:
I am getting error on the blue line. Thanks for helping. I am wanting to use this idea for some other purpose: but for now I want to know how to log on to this site.
If anyone can suggest or help me in any way i will really appriciate that.
Thanks again
Ped
Code
Option Explicit
Sub IE_login()
Dim ie As InternetExplorer
Dim C
Dim ULogin As Boolean, ieForm
Dim MyPass As String, MyLogin As String
redo:
MyLogin = Application.InputBox("Please enter your VBAX login", "VBAX username", Default:="ped", Type:=2)
MyPass = Application.InputBox("Please enter your VBAX password", "VBAX Password", Default:="", Type:=2)
If MyLogin = "" Or MyPass = "" Then GoTo redo
Set ie = New InternetExplorer
ie.Visible = True
ie.Navigate "[URL]http://www.ozgrid.com/forum/login.php?do=login[/URL]"
'Loop until ie page is fully loaded
Do Until ie.ReadyState = READYSTATE_COMPLETE
Loop
'Look for password Form by finding test "Password"
For Each ieForm In ie.Document.forms
If InStr(ieForm.innertext, "Password") <> 0 Then
ULogin = True
'enter details
[I][COLOR=blue]ieForm(0).Value = MyLogin[/COLOR][/I]
[I][COLOR=blue] ieForm(2).Value = MyPass[/COLOR][/I]
'login
ieForm.submit
Exit For
Else
End If
Next
If ULogin = False Then MsgBox "User is aleady logged in"
Set ie = Nothing
End Sub
Sub SetRefs()
Dim ObRef
On Error Resume Next
' Adds Internet Controls Ref
ThisWorkbook.VBProject.References.AddFromGuid "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}", 1, 1
End Sub
Display More