Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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 SubIf 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

![]() |
![]() |
![]() |

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