Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am looking for a way to hide all the buttons from the Excel context menu and just leave my buttons I created. I haven't found about it on internet. How can I do that?

Thanks!

share|improve this question

1 Answer 1

up vote 1 down vote accepted

I found a way to do this, When i got same problem..

If you want to remove any item

Sub RemoveItems()
    Application.CommandBars("Cell").Controls("Insert...").Delete
    Application.CommandBars("Cell").Controls("Cut").Delete
    Application.CommandBars("Cell").Controls("Copy").Delete
End Sub

Or if you want to delete all items then

Sub DeleteAll()
Set CtrlMenu = Application.CommandBars("Cell")
For Each Item In CtrlMenu.Controls
Item.Delete
Next
End Sub

If you want to restore again

Sub ResetMenu()
    Application.CommandBars("Cell").Reset
End Sub
share|improve this answer
    
Very Nice! That worked! It's perfect. Just one question: .Controls("Insert...") - Where do I get a list of control names? –  Braulio yesterday
    
Just right click ;) –  Jagadish Dabbiru yesterday

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.