Solved

How do I add a custom context menu item to the context menu of an Excel 2010 comment box

Posted on 2014-09-11
2
204 Views
Last Modified: 2014-09-13
I have code that inserts a picture into the comment box of an Excel cell.  I created this for a project where I had to do a mass population of a spreadsheet.  I would now like to add it to the context menu of the comment box that appears when you do a right click on the comment box.  

So I need to know how to create this item and execute my code when its selected?
0
Comment
Question by:NevSoFly
2 Comments
 
LVL 50

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 40318708
Hi,

pls try

Sub Menu_Modify()
Menu_reset
With CommandBars("Shapes")
    .Controls.Add(Type:=msoControlButton, before:=1).Caption = "&Add my Thing"
    .Controls("Add my thing").OnAction = "'" & ThisWorkbook.Name & "'!" & "myCode"
    .Controls(2).BeginGroup = True
End With

End Sub


Sub Menu_reset()
CommandBars("Shapes").Reset
End Sub

Open in new window

Regards
0
 

Author Closing Comment

by:NevSoFly
ID: 40320830
thanks that will do the trick.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question