Link to home
Start Free TrialLog in
Avatar of KingSencat
KingSencat

asked on

VB6.0 very simple question for WebBrowser

Hello experts!


I am doing my project with WebBrowser and i need to post some data to the webbrowser and then CLICK on the button to continue , i can post the data into the fields but i cannot click to continue , here is my source .
-------------------------
Private Sub Form_Load()
    WebBrowser1.Navigate "http://betonet.privetools.com/enrenew.php" ' WebSite
End Sub

Private Sub Command1_Click()
With WebBrowser1.Document
     .All("username").Value = Text5.Text  ' Username Box
     .All("kodikos").Value = Text7.Text ' Password Box
     End With
End Sub
Private Sub Command2_Click()
With WebBrowser1.Document
.All("Next >>").Click    ' Clicking the button Next >>           !!!THE PROBLEM IS HERE!!
End Sub
--------------------------
I receive this error when i am clicking the Command2--
" Object variable or with block variable not set. "
--------------------------
I am sure the valua name of the submit is "Next >>" , i try also "Submit" and the same error , please help me



Best regards!
Avatar of EDDYKT
EDDYKT
Flag of Canada image

should you add name or id in your


<INPUT TYPE="SUBMIT" VALUE="Next >>" class="s"style="font-weight:bold; color:#FFF; background-color:#0808FF; border-style:outset; border-color:#69F;">

to be

<INPUT TYPE="SUBMIT" VALUE="Next >>" name=btnbutton class="s"style="font-weight:bold; color:#FFF; background-color:#0808FF; border-style:outset; border-color:#69F;">


Private Sub Command2_Click()
With WebBrowser1.Document
.All("btnbutton").Click    ' Clicking the button Next >>           !!!THE PROBLEM IS HERE!!
End Sub
Avatar of KingSencat
KingSencat

ASKER

it is not my website so i cannot modify any source :( , any other way ?
have you tried

.all("SUBMIT").click
try this

Private Sub Command2_Click()

Dim obj

For Each obj In WebBrowser1.Document.All
    If (obj.nodeName = "INPUT") Then
        If (obj.defaultvalue = "Next >>") Then
            obj.Click
        End If
    End If
Next
End Sub
ASKER CERTIFIED SOLUTION
Avatar of AzraSound
AzraSound
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial