Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Fred Jacobowitz
 
Posts: n/a
Default Add items to context menu

Excel 2003
How do I add items to the context menu that appears when I right click. I
would like to add items that will run a vba function just as I can with
keystrokes using the Application.Onkey function.
Thank you,
Fred Jacobowitz


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson
 
Posts: n/a
Default Add items to context menu

That commandbar is called "Cell".

I saved this from a previous post:

This kind of thing might help:

Option Explicit
Sub auto_open()
With Application.CommandBars("cell")
On Error Resume Next
.Controls("DumpToFile").Delete
On Error GoTo 0

With .Controls.Add(Type:=msoControlButton, temporary:=True)
.BeginGroup = True
.Caption = "DumpToFile"
.OnAction = "'" & ThisWorkbook.Name & "'!yourmacronamehere"
End With
End With
End Sub
Sub auto_close()
With Application.CommandBars("cell")
On Error Resume Next
.Controls("DumpToFile").Delete
On Error GoTo 0
End With
End Sub
Sub yourmacronamehere()
MsgBox "hi from your macro!"
End Sub


Fred Jacobowitz wrote:

Excel 2003
How do I add items to the context menu that appears when I right click. I
would like to add items that will run a vba function just as I can with
keystrokes using the Application.Onkey function.
Thank you,
Fred Jacobowitz


--

Dave Peterson
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
Missing menu items Ken Setting up and Configuration of Excel 3 February 27th 06 07:58 AM
Remove Excel Menu Items robbybobby New Users to Excel 1 February 23rd 06 11:41 PM
greyed out menu items Jamie Excel Worksheet Functions 0 December 13th 05 05:09 PM
Enabling sub menu items via vba Dan Neely Excel Worksheet Functions 0 July 11th 05 04:48 PM
Menu items added with menu item editor in older versions Michael Hoffmann Excel Discussion (Misc queries) 2 January 7th 05 01:40 PM


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