Lost Menus & Toolbars with Right Click macro - HELP?

S

Silena K-K

Hi

I want to 'disable right clicking' of the mouse in Excel and found the code
below on the internet.

I copied it into my workbook but now when I open Excel - any workbook (new
or existing) I have no menu bar or toolbars (or right clicking which is what
I wanted) only the formula bar.

Please help??

Thanks and Merry Christmas. Silena

Private Sub Workbook_Open()
Application.CommandBars("Worksheet Menu Bar").Enabled = False
Application.CommandBars("Cell").Enabled = False
Application.CommandBars("Sheet").Enabled = False
Application.CommandBars("Ply").Enabled = False
Application.CommandBars("Row").Enabled = False
Application.CommandBars("Column").Enabled = False
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.CommandBars("Worksheet Menu Bar").Enabled = True
Application.CommandBars("Cell").Enabled = True
Application.CommandBars("Sheet").Enabled = True
Application.CommandBars("Ply").Enabled = True
Application.CommandBars("Row").Enabled = True
Application.CommandBars("Column").Enabled = True
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top