#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Popup Menu

I want to Add my own menu within the popup menu of the excel.
so that user can choose the functionality which I have provide by righ
clicking any cell of the sheet.

Any One can help me................

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Popup Menu

Fuzzy,

Here is an example

Sub addRightClick()
Dim oCtl As Office.CommandBarControl
With Application.CommandBars("cell")
On Error Resume Next
.Controls("myFunction").Delete
On Error GoTo 0
.Controls("Insert Comment").Visible = False
Set oCtl = .Controls.Add(temporary:=True)
With oCtl
.BeginGroup = True
.Caption = "myFunction"
.OnAction = "myMacro"
End With
End With
End Sub


--

HTH

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

"FuzzyLogic " wrote in message
...
I want to Add my own menu within the popup menu of the excel.
so that user can choose the functionality which I have provide by right
clicking any cell of the sheet.

Any One can help me.................


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Popup Menu

http://support.microsoft.com/default...b;en-us;166755
File Title: Customizing Menu Bars, Menus, and Menu Items in Microsoft(R)
Excel 97
File Name: WE1183.EXE
File Size: 58041 bytes
File Date: 06/20/97
Keywords: kbfile kbappnote
Description: This Application Note can help you learn techniques for writing
Visual Basic(R) for Applications code to customize menus in Microsoft Excel
97. This Application Note contains code examples that you can use with the
following elements: menu bars, menus, menu items, submenus, and shortcut
menus.


http://support.microsoft.com/?id=213209
XL2000: Sample Macros that Customize and Control Shortcut Menus

http://support.microsoft.com/?id=162878
XL97: Sample Macros That Customize and Control Shortcut Menus


Previous post by Andy Wiggins:
This file might be a help:
http://www.bygsoftware.com/examples/...UpMenuDemo.zip
It's in the "Menu Routines" section on page:
http://www.bygsoftware.com/examples/examples.htm

Demonstrates how to create and implement a popup menu.
The workbook covers two areas:
* Creating a popup menu
* Using the Right_Click event

The code is open and commented.


--
Regards
Andy Wiggins
www.BygSoftware.com
Home of "Save and BackUp",
"The Excel Auditor" and "Byg Tools for VBA"

-----
Previous Post by Ron de Bruin

If you mean the menu if you right click on a cell then try this

Sub AddToCellDropDown()
Dim CellDropDown As CommandBar
Dim MyDropDownItem As CommandBarControl

RemoveFromCellDropDown

Set CellDropDown = Application.CommandBars("Cell")
With CellDropDown.Controls.Add(Type:=msoControlButton, befo=1)
.Caption = "Try me"
.Style = msoButtonIconAndCaption
.FaceId = 59
.OnAction = ThisWorkbook.Name & "!Your_macro"
.Tag = "MyDropDownItem"
End With
End Sub

Sub RemoveFromCellDropDown()
Dim MyDropDownItem As CommandBarControl
Set MyDropDownItem =
Application.CommandBars.FindControl(Tag:="MyDropDo wnItem")
If Not MyDropDownItem Is Nothing Then
MyDropDownItem.Delete
End If
Set MyDropDownItem = Nothing
End Sub

Sub Your_macro()
MsgBox "Hi there."
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



--
Regards,
Tom Ogilvy



"FuzzyLogic " wrote in message
...
I want to Add my own menu within the popup menu of the excel.
so that user can choose the functionality which I have provide by right
clicking any cell of the sheet.

Any One can help me.................


---
Message posted from http://www.ExcelForum.com/



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Popup Menu

Extremely Thanx to Bob,

I works now.


Can please tell me about my previous post.

Installing AddIns through VB Application.


Regards.


Fuzz

--
Message posted from http://www.ExcelForum.com

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
Popup Menu / Shortcut Menu Dale Fye Excel Discussion (Misc queries) 2 October 12th 07 12:57 AM
Non-functional Popup Menu Boxes Jim_M Charts and Charting in Excel 0 January 20th 05 04:27 PM
I N D E X menu via Tabs Popup Greg[_13_] Excel Programming 0 November 12th 03 04:55 PM
add combo box at popup menu GUS Excel Programming 1 September 25th 03 07:27 AM
Modifying the right-click popup menu of a shape Don Lopez Excel Programming 2 July 23rd 03 10:03 PM


All times are GMT +1. The time now is 12:02 AM.

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"