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?
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?