April 2006
Beginner
1114 pages
98h 16m
English
commandbars.ActionControl
Returns the CommandBarControl object that ran the current procedure. If the current procedure was not run by a CommandBarControl, returns Nothing. The following code displays a message in the Immediate window when Sample2 is called from a menu item or toolbar button:
Sub Sample2( )
Dim cbc As CommandBarButton
MsgBox "Sample2"
Set cbc = Application.CommandBars.ActionControl
If Not cbc Is Nothing Then _
Debug.Print "Sample2 called by: " & cbc.Tag
End SubRead now
Unlock full access