Toggle large group of ActiveX OptionButtons at once

dfoakley

New Member
Joined
Jul 16, 2013
Messages
3
I created a form in Word 2010 using many ActiveX OptionButton controls across numerous GroupNames. After configuring all of the buttons I went through and tested them to make they were all grouped properly; now a third are set to "true", but I want them to all be set to "false" before I distribute the form. Right now, I'm just going into the VBA code and toggling each of them manually. Is there a better way to do toggle them all as a single macro?

I tried the following procedure
Code:
Sub Reset()
    Dim oShape As Shapes
    
    
    Set oShape = ThisDocument.Shapes
    
    For i = 1 To oShape.Count
        If oShape(i).OLEFormat.ClassType = "Forms.OptionButton.1" Then
            If oShape(i).OLEFormat.Object.Value = True Then
                oShape(i).OLEFormat.Object.Value = False
            End If
        End If
    Next


End Sub

But it doesn't do anything. I also tried referencing oShape as an OptionButton, but that just generated a bunch of type mismatch errors.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Forum statistics

Threads
1,223,162
Messages
6,170,432
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