Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default how do I add more toolbar options to my right click options

I am trying to add more toolbar options to my right click options
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default how do I add more toolbar options to my right click options

Hi Rosie

Maybe thiis
Or do you want to add buid in controls ?
See example below this example

This example will add 3 controls to the Cell menu that run your own macro's.

Change this two lines :

onaction_names = Array("macro1", "macro2", "macro3")
caption_names = Array("caption 1", "caption 2", "caption 3")


Sub Add_Controls()
Dim i As Long
Dim onaction_names As Variant
Dim caption_names As Variant
onaction_names = Array("macro1", "macro2", "macro3")
caption_names = Array("caption 1", "caption 2", "caption 3")
With Application.CommandBars("Cell")
For i = LBound(onaction_names) To UBound(onaction_names)
With .Controls.Add(Type:=msoControlButton)
.OnAction = ThisWorkbook.Name & "!" & onaction_names(i)
.Caption = caption_names(i)
End With
Next i
End With
End Sub

Sub Delete_Controls()
Dim i As Long
Dim caption_names As Variant
caption_names = Array("caption 1", "caption 2", "caption 3")
With Application.CommandBars("Cell")
For i = LBound(caption_names) To UBound(caption_names)
On Error Resume Next
.Controls(caption_names(i)).Delete
On Error GoTo 0
Next i
End With
End Sub



This example will add the Save and Print control to the cell menu.

Sub Add_Cell_Menu_Items()
Dim IDnum As Variant
Dim N As Integer

IDnum = Array("3", "4")

For N = LBound(IDnum) To UBound(IDnum)
On Error Resume Next
Application.CommandBars("Cell").Controls.Add _
Type:=msoControlButton, ID:=IDnum(N), befo=1
On Error GoTo 0
Next N
End Sub

Sub Delete_Cell_Menu_Items()
Dim IDnum As Variant
Dim N As Integer

IDnum = Array("3", "4")

For N = LBound(IDnum) To UBound(IDnum)
On Error Resume Next
Application.CommandBars("Cell").FindControl(ID:=ID num(N)).Delete
On Error GoTo 0
Next N
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Rosie" wrote in message ...
I am trying to add more toolbar options to my right click options



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
right click menu shortcut changed from 2002 to 2003 furia Excel Discussion (Misc queries) 2 May 30th 06 10:32 PM
Where is the toolbar with the "bold type", "font type", options fwccbcc New Users to Excel 2 May 3rd 06 09:11 PM
Spreadsheet shortcuts not working brt Setting up and Configuration of Excel 2 April 26th 06 01:57 PM
CANT SAVE TOOLBAR CHANGES EXCEL 2003) Paul628 Excel Discussion (Misc queries) 2 November 8th 05 07:48 PM
How do I set Save Options? DeweyG Excel Discussion (Misc queries) 1 September 14th 05 01:35 AM


All times are GMT +1. The time now is 07:02 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"