decadence
Well-known Member
- Joined
- Oct 9, 2015
- Messages
- 525
- Office Version
- 365
- 2016
- 2013
- 2010
- 2007
- Platform
- Windows
Hi, I am having an issue where the Insert... Function is not being removed when I open Excel, However if i run through it manually it will remove it. Doesn't make sense because I have checked the Spelling to match the right click button. See code below
Code:
Private Sub Workbook_Open()
Application.CommandBars("Cell").Reset
On Error Resume Next
With Application
.CommandBars("Cell").Controls("Name a Range...").Delete
.CommandBars("Cell").Controls("Pick From Drop-down List...").Delete
.CommandBars("Cell").Controls("Insert Comment").Delete
.CommandBars("Cell").Controls("Filter").Delete
.CommandBars("Cell").Controls("Sort").Delete
.CommandBars("Cell").Controls("Clear Contents").Delete
.CommandBars("Cell").Controls("Delete...").Delete
.CommandBars("Cell").Controls("Paste Special...").Delete
.CommandBars("Cell").Controls("Insert...").Delete
End With
On Error GoTo 0
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
On Error Resume Next
Application.CommandBars("Cell").Reset
On Error GoTo 0
End Sub