Trouble clicking a button in IE using VBA

DC83

New Member
Joined
Jul 4, 2012
Messages
3
I am trying to submit a form on a webpage. It doesn't matter to me whether its done by attempting to click the button or submitting the form. I just started attempting to automate IE for the first time a few days ago. I apologize for any miscommunication on my part. Any help anyone could provide is appreciated.

Rich (BB code):
Rich (BB code):
Dim objIE As Object
    Set objIE = CreateObject("InternetExplorer.Application")
        objIE.Navigate "My Url"
        objIE.Visible = True
    Do
    DoEvents
    Loop Until objIE.ReadyState = 4
    objIE.document.GetElementByID("dnd").Click
    objIE.document.GetElementByID("classic").Click
    objIE.document.GetElementByID("I am attempting to click button at this point").Click


I have tried using this as well, but it does not submit the form I want.

Rich (BB code):
Rich (BB code):
objIE.Document.forms(0).submit


Here is the html code relevant to the button I want to click.

Rich (BB code):
Rich (BB code):
 <em><input name="jsubmit" type="submit" value="Submit Changes" class="ysf-cta ysf-cta-small ysf-cta-save"> <input type="submit" name="jsubmit" value="Cancel" class="ysf-cta ysf-cta-small ysf-cta-reset ysf-cta-cancel" disabled></em>

</pre>
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
My Mistake: Here is the html code

HTML:
 <em><input name="jsubmit" type="submit" value="Submit Changes" class="ysf-cta ysf-cta-small ysf-cta-save"> <input type="submit" name="jsubmit" value="Cancel" class="ysf-cta ysf-cta-small ysf-cta-reset ysf-cta-cancel" disabled></em>
 
Upvote 0

Forum statistics

Threads
1,214,904
Messages
6,122,169
Members
449,070
Latest member
webster33

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top