Attach a Macro to an ActiveX Control

ActiveX Controls are newer and slightly more complicated to set up. Rather than simply assign a macro to the button, you will have a button_click procedure where you can either call another macro or have the macro code actually embedded in the button_click procedure. Follow these steps:

1. From the menu, select View, Toolbars, Control Toolbox.

2. Click the Command Button icon on the Control Toolbox toolbar. Draw a button shape on the worksheet as described in Step 6 for the Forms button.

3. To format the button, click the Properties icon in the toolbox. You can now adjust the button's caption and color in the Properties window, as shown in Figure 24.10.

¡¡j There is one annoying aspect of this Properties window. It is huge and covers a large portion of your ° worksheet. Eventually, if you want to use the worksheet,you are going to have to close this Properties window.When you close the Properties window, it also hides the Properties window in the Visual Basic Editor.You can see that this is missing in Figure 24.11.I would prefer that I could close this Properties window without affecting my VBE editor environment.

0 0

Post a comment