Go Premium for a chance to win a PS4. Enter to Win

x
?
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
Medium Priority
?
217 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 53

Accepted Solution

by:
Rgonzo1971 earned 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
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.

782 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