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: 3
Default How to Activate procedure with parameters

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
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
sub procedure Jim Excel Discussion (Misc queries) 2 November 12th 09 02:52 PM
Stop a Procedure from another procedure Ayo Excel Discussion (Misc queries) 1 October 30th 08 01:42 AM
VBA Procedure Jeff Excel Discussion (Misc queries) 0 January 20th 06 04:22 PM
Stored Procedure call and passing parameters TLowe Excel Programming 3 April 23rd 04 10:09 AM


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

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

About Us

"It's about Microsoft Excel"