Solved

Having trouble pressing HTML button from VB6

Posted on 2011-03-24
8
480 Views
Last Modified: 2012-05-11
Normally to press a button, it works great to:
WebBrowser2.Document.All("btnUpdateTotals2").Click

But I have a button that is not cooperating:
'<input type="submit" name="cmdsave" id="cmdsave" class="fBtn11" value="Save">

How can I press this button?
0
Comment
Question by:hrolsons
  • 4
  • 3
8 Comments
 
LVL 4

Expert Comment

by:GeoffHarper
ID: 35210235
Do you mean you are trying

     WebBrowser2.Document.All("cmdsave").Click

and it doesn't work?
0
 

Author Comment

by:hrolsons
ID: 35210559
That is correct, I get:
Run-time error '91':
Object variable or With block variable not set
0
 
LVL 4

Expert Comment

by:GeoffHarper
ID: 35210859
The <INPUT> tag is within the <FORM> tag (just making sure)?
0
 

Author Comment

by:hrolsons
ID: 35210896
Yes, the page I'm working with is "View Sales Record" on eBay.

<form>
...
<input type="submit" name="cmdsave" id="cmdsave" class="fBtn11" value="Save">
...
</form>
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 4

Expert Comment

by:GeoffHarper
ID: 35210944
It's not inside an <IFRAME> is it?  I've had situations where "View Source" would show me the whole page, but I wouldn't have access to the <IFRAME> within.

Just a thought...

0
 

Author Comment

by:hrolsons
ID: 35210996
No <IFRAME> on the page.
0
 
LVL 5

Accepted Solution

by:
MedievalWarrior earned 500 total points
ID: 35211505
Try something like this
WebBrowser1.Document.GetElementById("cmdSave").Click

' OR

WebBrowser1.Document.GetElementById("cmdSave").Submit

Open in new window

0
 

Author Comment

by:hrolsons
ID: 35212144
MedievalWarrior....


Ding....Ding.....Ding...We have a winner!!!!!!!!!!!!!!!!!!!!

The first one worked perfect, upper case "S" and all!!!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

932 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now