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
195 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 48

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now