LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Application.Caller Marcelo Excel Discussion (Misc queries) 6 June 23rd 06 03:07 PM
Row = Application.Caller.Row Charles Woll Excel Worksheet Functions 8 February 28th 05 02:04 PM
application.caller Jase Excel Programming 0 January 6th 04 03:51 AM
Application.caller Clark B Excel Programming 2 July 29th 03 11:17 PM
DDE and application.caller help Ross Kaminsky Excel Programming 1 July 17th 03 04:17 PM


All times are GMT +1. The time now is 08:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"