Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to disable worksheet tabs 1

Status
Not open for further replies.

zerocul

Programmer
Sep 9, 2002
18
US
I am looking for a way to disable the right-click popup menu that appears when you right-click over a worksheet tab. Specifically, I want to disable the DELETE command on the popup menu that appears when you right-click over the worksheet tab. I would prefer not to hide the tabs, just disable the specific command. I have been working with the application.commandbars("Workbook tabs").controls VBA code, just haven't been able to progress beyond this point. Any help would be appreciated. Thanks in advance.
 
Hi
I'd love to point you to one of my FAQs on disabling but neither of them deal with this instance directly! One of them (faq707-4727) needs updating to make it easier to use but has code to list all the commandbars etc.

But the code you need is

Code:
'Disable the whole menu
CommandBars("ply").Enabled = False
'OR
'disable just DELETE from the menu
CommandBars("ply").Controls("Delete").Enabled = False

Don't ask me what "ply" is, I simply don't know!!!

;-)

If a man says something and there are no women there to hear him, is he still wrong? [ponder]
The faqs ma'am, just the faqs. Get the best from these forums : faq222-2244
 
Loomah,

Thanks for the post, works great. Much appreciation. And yeah, like you said, what's up with "ply"?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top