Rightclicking tabs disabled, won't enable anymore

L

Legacy 108787

Guest
I posted this here: http://stackoverflow.com/questions/494926/right-click-on-sheet-tabs-disabled-in-excel
As well.

I used this vba code in the ThisWorkbook module to disable the right click menu in an Excel workbook.

Code:
Private Sub Workbook_Activate()
    With Application.CommandBars.FindControl(ID:=847)
        .Visible = False
    End With
End Sub

Private Sub Workbook_Deactivate()
    With Application.CommandBars.FindControl(ID:=847)
        .Visible = True
    End With
End Sub

<code> </code> Works like a charm.
Problem is, I can't access the right click menu on tabs in ANY workbook now. The second part of the code is supposed to turn it back on, I assumed?

Even when I remove the code entirely, no workbook, not even a new one, has a menu when I click right on one of the tabs.
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
<code>
Code:
Application.CommandBars("Ply").Enabled = True
And the code I posted above doesn't disable the entire menu, it disables the "Delete" option in the menu.
</code>
 
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,426
Members
448,961
Latest member
nzskater

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top