Run Macro from a Control Button and linking to AddIn's
Fred,
There are 2 types of command buttons in Excel - ActiveX
and forms. They require different approach to program.
Most likely you have created an ActiveX button
(from "Control toolbox" toolbar) while reading help for
the Form button (from "Forms" toolbar).
To solve the problem: delete your button; open a toolbar
called "Forms" and create a new button from it. Should
work now.
Best -
Andrei
-----Original Message-----
Please can anyone help with this problem please. (Fred.)
I am following the help file to Run a Macro from a
Control Button (see
below) I have placed on one of my Sheets. As you can see
from the help
instruction below I should be able to select a control
handle then right
click and select add a Macro. the problem is when I right
click this option
isn't shown or available in the list. Do I need to set up
any references if
so which.
Also if I was to make one of my files which contained
Macros, Subs or
Functions into an Add-In, then how would I call each of
the Macros, Subs or
Functions from another New sheet assuming I had the Add-
In registered via
Tools - Add-Ins etc.
This is the Help file I am following for using the Macro
from a Button
1.. Click the button or graphic control so that sizing
handles appear.
2.. With the graphic object selected, right-click a
sizing handle of the
button or graphic object to display the shortcut menu.
3.. On the shortcut menu, click Assign Macro.
4.. Do one of the following:
a.. To assign an existing macro to the button or
graphic object, enter
the name of the macro in the Macro name box, and then
click OK.
b.. To record a new macro to assign to the selected
graphic object,
click Record. When you finish recording the macro, click
Stop Recording on
the Stop Recording toolbar.
c.. To write a new macro in the Visual Basic Editor,
click New. To edit
an existing macro, click the name of the macro in the
Macro Name box, and
then click Edit.
Note If you assign a macro to a button or other object
that is already in
use as a hyperlink, the hyperlink information is deleted.
From then on,
clicking the button or object runs the macro instead.
End of Help
Best Regards Fred
|