Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In the chapter 4 ("Microsoft excel object") of Microsoft Office 97/
Visual Basic Programmer's guide I got sample code of adding extra function for the right click menu. I have a problem with Onaction property, when I tried also include parameters for sub. I need to run sub with "Target" ( the cell on which I clicked with right button) as parameter but VBA doesn't allow to do that. Also I wanted to know why the sample code set Control.Tag (icbc.Tag) as brccm. For what the Tag property is used. And should I allways use "brccm" as Tag value. I am working on XL2000 This is the code I use: Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean) For Each icbc In Application.CommandBars("cell").Controls If icbc.Tag = "brccm" Then icbc.Delete Next icbc If Not Application.Intersect(Target.Cells(1, 1), Range("A:A")) Is Nothing Then With Application.CommandBars("cell").Controls _ .Add(Type:=msoControlButton, befo=1, Temporary:=True) .Caption = "Jauns instruments" .OnAction = "mkrInstr" .Tag = "brccm" End With End If Thank you, Ivars |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
sub procedure | Excel Discussion (Misc queries) | |||
Stop a Procedure from another procedure | Excel Discussion (Misc queries) | |||
VBA Procedure | Excel Discussion (Misc queries) | |||
Stored Procedure call and passing parameters | Excel Programming |