Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Amending Right-Click Options

Hello everyone

I've added options to the right-click menu using

With Application.CommandBars("Query").Controls.Add
(temporary:=True)
.Caption = "Download All &Transactions for this
Element"
.BeginGroup = True
.FaceId = 458
.OnAction = "DownloadAllTransactionsForThisElement"
End With

Now I'd like to remove all the default options that
appear when I right-click on a cell that is part of
a "Query", particularly the "Edit Query" and "Data Range
Properties Options". Does anyone have any ideas?

Thanks in advance

Matt

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Amending Right-Click Options

Matt,

I don't seem to have a Query commandbar, but if there is one, you should be
able to see all the control names with


For Each ctl In Application.CommandBars("Query")
Debug.Print ctl.Caption
Next ctl

THen fior each, just run


With Application.CommandBars("Query")
.Controls("name1").Visible = False
End With

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Matt" wrote in message
...
Hello everyone

I've added options to the right-click menu using

With Application.CommandBars("Query").Controls.Add
(temporary:=True)
.Caption = "Download All &Transactions for this
Element"
.BeginGroup = True
.FaceId = 458
.OnAction = "DownloadAllTransactionsForThisElement"
End With

Now I'd like to remove all the default options that
appear when I right-click on a cell that is part of
a "Query", particularly the "Edit Query" and "Data Range
Properties Options". Does anyone have any ideas?

Thanks in advance

Matt



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Amending Right-Click Options

Hi Bob

Thank you for this.
The query toolbar will appear when you right-click on any
data in query you have created using Microsoft Query.

For Each ctl In Application.CommandBars("Query")
Debug.Print ctl.Caption
Next ctl

Gives me an error message "Object does not support this
property or method." Not sure what this means?

Regards


Matt


-----Original Message-----
Matt,

I don't seem to have a Query commandbar, but if there is

one, you should be
able to see all the control names with


For Each ctl In Application.CommandBars("Query")
Debug.Print ctl.Caption
Next ctl

THen fior each, just run


With Application.CommandBars("Query")
.Controls("name1").Visible = False
End With

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Matt" wrote in

message
...
Hello everyone

I've added options to the right-click menu using

With Application.CommandBars("Query").Controls.Add
(temporary:=True)
.Caption = "Download All &Transactions for this
Element"
.BeginGroup = True
.FaceId = 458
.OnAction = "DownloadAllTransactionsForThisElement"
End With

Now I'd like to remove all the default options that
appear when I right-click on a cell that is part of
a "Query", particularly the "Edit Query" and "Data

Range
Properties Options". Does anyone have any ideas?

Thanks in advance

Matt



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Amending Right-Click Options

Matt,

Sorry, I always make that mistake. Try this version

For Each ctl In Application.CommandBars("Query").Controls
Debug.Print ctl.Caption
Next ctl


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Matt" wrote in message
...
Hi Bob

Thank you for this.
The query toolbar will appear when you right-click on any
data in query you have created using Microsoft Query.

For Each ctl In Application.CommandBars("Query")
Debug.Print ctl.Caption
Next ctl

Gives me an error message "Object does not support this
property or method." Not sure what this means?

Regards


Matt




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Amending Right-Click Options

Hi Bob

That's excellent thank you

Have used ........

Dim ctl As String
Dim strCntrl As String

Application.CommandBars("Query").Reset

For Each ctl In Application.CommandBars("Query").Controls
Debug.Print ctl.Caption
strCntrl = ctl.Caption

With Application.CommandBars("Query")
.Controls(strCntrl).Visible = False
End With
Next ctl

To get rid of them all before I add my own

Thank you very much indeed

Matt

-----Original Message-----
Matt,

Sorry, I always make that mistake. Try this version

For Each ctl In Application.CommandBars

("Query").Controls
Debug.Print ctl.Caption
Next ctl


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Matt" wrote in

message
...
Hi Bob

Thank you for this.
The query toolbar will appear when you right-click on

any
data in query you have created using Microsoft Query.

For Each ctl In Application.CommandBars("Query")
Debug.Print ctl.Caption
Next ctl

Gives me an error message "Object does not support this
property or method." Not sure what this means?

Regards


Matt




.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Amending Right-Click Options

Matt,

ctl should not be declared as a string. It is either a generic Object or a
specific CommandbarControl.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Matt" wrote in message
...
Hi Bob

That's excellent thank you

Have used ........

Dim ctl As String
Dim strCntrl As String

Application.CommandBars("Query").Reset

For Each ctl In Application.CommandBars("Query").Controls
Debug.Print ctl.Caption
strCntrl = ctl.Caption

With Application.CommandBars("Query")
.Controls(strCntrl).Visible = False
End With
Next ctl

To get rid of them all before I add my own

Thank you very much indeed

Matt

-----Original Message-----
Matt,

Sorry, I always make that mistake. Try this version

For Each ctl In Application.CommandBars

("Query").Controls
Debug.Print ctl.Caption
Next ctl


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Matt" wrote in

message
...
Hi Bob

Thank you for this.
The query toolbar will appear when you right-click on

any
data in query you have created using Microsoft Query.

For Each ctl In Application.CommandBars("Query")
Debug.Print ctl.Caption
Next ctl

Gives me an error message "Object does not support this
property or method." Not sure what this means?

Regards


Matt




.



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
CHANGE RIGHT CLICK OPTIONS gams sb Excel Discussion (Misc queries) 2 May 27th 08 04:04 PM
Right click delete options LDP Analyst[_2_] Excel Discussion (Misc queries) 2 March 13th 08 04:45 PM
further options following a command button click thesaxonuk Excel Discussion (Misc queries) 0 October 23rd 06 01:46 PM
how do I add more toolbar options to my right click options Rosie Excel Discussion (Misc queries) 1 August 11th 06 04:52 PM
Right click in cell menu options AlisonJS Excel Discussion (Misc queries) 5 April 6th 06 01:41 PM


All times are GMT +1. The time now is 02:46 PM.

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"