Select Radio Buttons in IE

OHtoMSP

New Member
Joined
Aug 26, 2011
Messages
7
I'm attempting to use VBA from excel to select one of two radio buttons in internet explorer. I can get the webpage to open, but cannot get the radio buttons selected.

Below is the code of the webpage. I want it to select the Cartons radio button.

Code:
<TABLE width="100%" border="0">
<TR>
<TD width="30%"><!--<input type="radio" name="UNIT_EACHES" value="" ******* = "javascript:eachesRadioClick();"/>EACHES-->
<input type="radio" tabindex="10" style="color: #FF0000"
                   name="UNIT_MEASURE"
                   value="Units"
                   >  Units</TD>
                                                      </TR>
                                                      <TR>
<TD width="30%"><!--  <input type="radio" name="UNIT_CASES" value="" ******* = "javascript:casesRadioClick();"  />CASES  -->
<input type="radio" style="color: #FF0000" name="UNIT_MEASURE"
                  value="Cartons"
                                              >  Cartons</TD>
                                                      </TR>
                                               </TABLE>
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
<font face=Courier New><SPAN style="color:#00007F">Sub</SPAN> Select_Cartons()<br><br>    <SPAN style="color:#007F00">' Set a reference to 'Microsoft Internet Controls' under the VBA Tools\References menu</SPAN><br>    <SPAN style="color:#00007F">Dim</SPAN> IE <SPAN style="color:#00007F">As</SPAN> InternetExplorer<br>    <br>    <SPAN style="color:#00007F">Set</SPAN> IE = <SPAN style="color:#00007F">New</SPAN> InternetExplorer<br>    <br>    IE.Navigate "http://www.mrexcel.com/forum/showthread.php?t=574836"<br>    IE.Visible = <SPAN style="color:#00007F">True</SPAN><br>    <SPAN style="color:#00007F">Do</SPAN><br>        DoEvents<br>    <SPAN style="color:#00007F">Loop</SPAN> <SPAN style="color:#00007F">Until</SPAN> IE.ReadyState = READYSTATE_COMPLETE<br>    <br>    IE.Document.All("UNIT_MEASURE").Item(1).Checked = <SPAN style="color:#00007F">True</SPAN><br>    <br>    <SPAN style="color:#007F00">'Select Units</SPAN><br>    <SPAN style="color:#007F00">'IE.Document.All("UNIT_MEASURE").Item(0).Checked = True</SPAN><br>    <br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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