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!
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!
ASKER
it is not my website so i cannot modify any source :( , any other way ?
have you tried
.all("SUBMIT").click
.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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
<INPUT TYPE="SUBMIT" VALUE="Next >>" class="s"style="font-weigh
to be
<INPUT TYPE="SUBMIT" VALUE="Next >>" name=btnbutton class="s"style="font-weigh
Private Sub Command2_Click()
With WebBrowser1.Document
.All("btnbutton").Click ' Clicking the button Next >> !!!THE PROBLEM IS HERE!!
End Sub