Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Application.Caller
I'm wresting with an issue regarding the Caller property. I have used
it to identify what buttons on a worksheet have been clicked, as follows : Sub My_Application_Caller() ' Application.Caller responds with the name of the control that was activated ' ie, the button that was pressed. This enables the assigned button name to be ' used in the macro as a variable. MsgBox Application.Caller Select Case Application.Caller Case "Button_Application_Caller" MsgBox "Macro called directly by the " & Application.Caller & " button!" Case Else ' Some other method MsgBox "Macro called via the Procedure, " & Application.Caller & " button!" End Select End Sub (On the side, even if I use a button to call another procedure which itself calls the procedure My_Application_Caller, the originating button call is remembered. Naming the buttons xxx_1, xxx_2 etc enables the assigned button name to be easily used in a procedure as a variable). The problem is trying apply this to Toolbar buttons. It may not be possible, but I would welcome any assistance. The MsgBox gives "Run Time Error 13, Type Mismatch" which sounds pretty conclusive (probably the #REF! error value). When I used the macro recorder to record copying a toolbar button from one bar to another, it gave me : Application.CommandBars("Custom Popup 7255480").Controls(10).Copy Bar:= _ Application.CommandBars("Custom Popup 7255539") which may indicate something to someone! Any help would be much appreciated, Regards, Mark |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Application.Caller | Excel Discussion (Misc queries) | |||
Row = Application.Caller.Row | Excel Worksheet Functions | |||
application.caller | Excel Programming | |||
Application.caller | Excel Programming | |||
DDE and application.caller help | Excel Programming |