[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 492
  • Last Modified:

Having trouble pressing HTML button from VB6

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
hrolsons
Asked:
hrolsons
  • 4
  • 3
1 Solution
 
GeoffHarperCommented:
Do you mean you are trying

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

and it doesn't work?
0
 
hrolsonsAuthor Commented:
That is correct, I get:
Run-time error '91':
Object variable or With block variable not set
0
 
GeoffHarperCommented:
The <INPUT> tag is within the <FORM> tag (just making sure)?
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
hrolsonsAuthor Commented:
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
 
GeoffHarperCommented:
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
 
hrolsonsAuthor Commented:
No <IFRAME> on the page.
0
 
MedievalWarriorCommented:
Try something like this
WebBrowser1.Document.GetElementById("cmdSave").Click

' OR

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

Open in new window

0
 
hrolsonsAuthor Commented:
MedievalWarrior....


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

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

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now