Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Menu bar question

I have added the following to my right click before to add an item to the
menu bar.

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As
Boolean)

Dim NewItem As CommandBarButton

Application.CommandBars("Cell").Reset


If Not Application.Intersect(Target, Range("c2:AZ1000")) _
Is Nothing Then
Set NewItem = Application.CommandBars("Cell").Controls.Add
With NewItem
.Caption = "Show Open Cuts/Po's"
.OnAction = "ShowDetail"
.BeginGroup = True
End With
End If


End Sub




However I'm now trying to add it to the right click on some cells that I
don't think have the "CELL" command bar as the one that's being used.
I'm trying to add it on a cell that is part of a MS Query.

Can you tell me the commandbar to add it to, or tell me some way to
determine what the command bar should be?


Thanks,
Alan Sawyer
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Menu bar question

Hi Alan,

Try:
Application.CommandBars("Query")
or
Application.CommandBars("Query Layout")


---
Regards,
Norman



wrote in message
...
I have added the following to my right click before to add an item to the
menu bar.

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As
Boolean)

Dim NewItem As CommandBarButton

Application.CommandBars("Cell").Reset


If Not Application.Intersect(Target, Range("c2:AZ1000")) _
Is Nothing Then
Set NewItem = Application.CommandBars("Cell").Controls.Add
With NewItem
.Caption = "Show Open Cuts/Po's"
.OnAction = "ShowDetail"
.BeginGroup = True
End With
End If


End Sub




However I'm now trying to add it to the right click on some cells that I
don't think have the "CELL" command bar as the one that's being used.
I'm trying to add it on a cell that is part of a MS Query.

Can you tell me the commandbar to add it to, or tell me some way to
determine what the command bar should be?


Thanks,
Alan Sawyer



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Menu bar question

Thanks, I'll give it a try in the morning when I get into the office.
Alan
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Menu bar question

Hi Alan,

You might like to download John Green's nice CBList addin which, amongst
other things, lists all CommandBars It also provides a listing of all Popup
menus and their constituent elements.

It is freely downloadable from Rob Bovey's Office automation site:

http://www.oaltd.co.uk/MVP/Default.htm


---
Regards,
Norman


wrote in message
...
Thanks, I'll give it a try in the morning when I get into the office.
Alan



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Menu bar question

"Query" worked.
Thanks a lot. I just couldn't figure out which one was correct.

Thanks again,
Alan Sawyer


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Menu bar question

I'll sure take a look.
Thanks,
Alan
Reply
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
Question on using a Drop Down Menu. turtlegalaxy Excel Discussion (Misc queries) 1 July 1st 08 01:43 AM
Menu /toolbar question Alan M Excel Programming 1 September 7th 05 07:09 PM
Custome menu question Alan M Excel Programming 3 August 5th 05 03:36 PM
Question About customized menu bar filo666 Excel Programming 2 July 15th 05 07:00 PM
Addin Menu Question ExcelMonkey[_190_] Excel Programming 1 February 7th 05 12:54 PM


All times are GMT +1. The time now is 07:24 PM.

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"