Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

VB6.0 very simple question for WebBrowser

Posted on 2006-06-05
5
Medium Priority
?
774 Views
Last Modified: 2008-01-09
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!
0
Comment
Question by:KingSencat
  • 3
5 Comments
 
LVL 26

Expert Comment

by:EDDYKT
ID: 16832031
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
0
 

Author Comment

by:KingSencat
ID: 16832666
it is not my website so i cannot modify any source :( , any other way ?
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 16832862
have you tried

.all("SUBMIT").click
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 16833032
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
0
 
LVL 28

Accepted Solution

by:
AzraSound earned 2000 total points
ID: 16834235
You should be able to just submit the form directly, e.g.,

WebBrowser.Document.forms(0).submit
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month21 days, 2 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question