Option button taking focus?

MT_Shanachie

New Member
Joined
Apr 30, 2002
Messages
48
I have a spreadsheet in which the user makes a choice with an option button (from the control toolbox) and then runs a macro using a CommandButton (also from the control toolbox).

The problem is that if I select an option button and then click the button to run the macro, I get a run-time error (1004; Method 'Calculation' of '_Application' failed) on the code that turns off calculation. I don't get the error if I select a cell in the worksheet prior to clicking the button to run the macro.

I know about the TakeFocusOnClick property of CommandButtons and I thought that the property might be set to TRUE on the option buttons, but the option buttons don't appear to have that property.

In this case I can work around the problem by selecting a cell from within the macro. But for future reference, is there a property of the option button that prevents it from taking the focus, or is there something else I'm missing here?
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

Forum statistics

Threads
1,143,708
Messages
5,720,388
Members
422,282
Latest member
psunith

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
Top