Computing.Net > Forums > Programming > VB6 Webpage button press

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

VB6 Webpage button press

Reply to Message Icon

Name: vedekandy
Date: July 21, 2005 at 05:17:23 Pacific
OS: Win XP Pro SP2, VB6 SP6
CPU/Ram: Athlon XP2600, 512Mb
Comment:

I wonder if anyone can help me. I've been using VB6 for years, but never really had much experience with the IE side of things. My "mission" is to write a program for VB6 that automates a button press on a webpage when ran. I thought this would be simple, but it seems not!

This is the code I have so far, thanks to other people's advice:

Private Sub Form_Load()
Dim oIE As Object, sURL As String
sURL = "http://www.rpgtopsites.com/in.php3?list=978316149&site=kingdomrpg"
Set oIE = CreateObject("InternetExplorer.Application")
oIE.Visible = True
Call oIE.navigate("http://www.rpgtopsites.com/in.php3?list=978316149&site=kingdomrpg")
Do Until oIE.LocationURL = sURL And oIE.readyState = 4
DoEvents
Loop
oIE.document.Form1.submit1.Click
End Sub

If I try this, the page loads fine ... then I get Error 438, "Object does not support this property or method". So then I changed the second to last line to this:

oIE.document.Forms(0).submit

This doesn't give me an error - but it also doesn't work. All that happens is that the page loads, but it hasn't actually submitted anything by pressing the button. The code on the actual page that governs the form is as follows:

<form action=in.php3 method=post>
<input type=hidden name=val1 value="xxxxxxx">
<input type=hidden name=val2 value="xxxxxxx">
<input type=submit name=val3 value="Press the button!">
</form>

Am I missing something really elementary here? All that seems to happen when VB6 triggers the "submit" thing is that it loads the in.php3 page, but without having passed anything to it, or so it seems. Is there another way to go about this?

-Andy



Sponsored Link
Ads by Google

Response Number 1
Name: StuartS
Date: July 21, 2005 at 06:35:40 Pacific
Reply:

You would be better of asking that question in the Web Development forum.

Stuart


0

Response Number 2
Name: vedekandy
Date: July 21, 2005 at 18:22:17 Pacific
Reply:

Good point .... can I repost it there, do you think, or will I fall foul of cross-posting?


0

Response Number 3
Name: StuartS
Date: July 21, 2005 at 18:52:54 Pacific
Reply:

I don't think so. It is unlikely you are going to get an answer in the XP Forum. A bit to specific to web programing and very little to do with XP.

Stuart


0

Response Number 4
Name: daniel.deepak
Date: August 10, 2005 at 05:17:20 Pacific
Reply:

Hi,
This might help.

Do Until oIE.ReadyState = READYSTATE_COMPLETE
Loop

Regards
Daniel Joseph
RAW,Accenture


Daniel Joseph,RAW Accenture


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: VB6 Webpage button press

VB6 cmd button needed www.computing.net/answers/programming/vb6-cmd-button-needed/1274.html

VB6 Command Button www.computing.net/answers/programming/vb6-command-button/6727.html

Visual C++: Tabbing around controls www.computing.net/answers/programming/visual-c-tabbing-around-controls/2695.html