hi

there is a small problem in codes need help

i am useing these codes

and here is site login link
http://crypo.freeforums.org/ucp.php?mode=login

Private Sub cmdlogin_Click()
WebBrowser1.Navigate "http://crypo.freeforums.org/ucp.php?mode=login"
lblstatus.Caption = "Connecting...."
End Sub




Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If URL = "http://crypo.freeforums.org/ucp.php?mode=login" Then
WebBrowser1.Document.All("Username").Value = user.Text
WebBrowser1.Document.All("Password").Value = pass.Text
WebBrowser1.Document.All("Login").Click  "problem is in this line"
End If
End Sub

WebBrowser1.Document.All("Login").Click

how it can b fixed need help

Recommended Answers

All 8 Replies

Hi,

May be the button name does not match...
what you can do is search all the objects in the webpage, and click based on the caption..
Check here:
http://vbcity.com/forums/t/94102.aspx

Regards
Veena

still not fixed
any 1 will like to reply and help?

Hi,

Are you sure button name is "Login"...?

i attch projct

no 1 able to fix my problem?

Hi,

This works... But may be login name/ password are invalid...

Dim Doc
Dim thing
If URL = "http://crypo.freeforums.org/ucp.php?mode=login" Then
    WebBrowser1.Document.All("Username").Value = user.Text
    WebBrowser1.Document.All("Password").Value = pass.Text
    Set Doc = WebBrowser1.Document
    For Each thing In Doc.All
        If thing.tagname = "INPUT" Then
            If thing.Type = "submit" Then
                If thing.Value = "Login" Then
                    thing.Click
                    Exit For
                End If
            End If
        End If
    Next
End If

Regards
Veena

thank you soo much this thing works

gona love this site :p

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.