T
Tim
I'm stuck!
I have a code (below) to disable the cut copy and paste features in a
workbook.
1. from the edit menu
2. the actual comand buttons (the toolbar buttons)
3. ctr c etc
4. right click options.
My prombem is that I get a runtime error 5 saying that this is an
invalid proceedure.
Any help on the bug here would be appreciated.
Thanks
Tim
Private Sub Workbook_Activate()
Application.CommandBars("Standard").Controls("Cut").Delete
Application.CommandBars("Standard").Controls("Copy").Delete
Application.CommandBars("Standard").Controls("Paste").Delete
Application.CommandBars("Formatting").Controls("Cut").Delete
Application.CommandBars("Formatting").Controls("Copy").Delete
Application.CommandBars("Formatting").Controls("Paste").Delete
Application.CellDragAndDrop = False
Application.CutCopyMode = False
Application.OnKey "^X", ""
Application.OnKey "^C", ""
End Sub
Private Sub Workbook_Deactivate()
Application.CommandBars(1).Reset
Application.CellDragAndDrop = True
Application.CutCopyMode = True
Application.OnKey "^X", "^X"
Application.OnKey "^C", "^C"
End Sub
I have a code (below) to disable the cut copy and paste features in a
workbook.
1. from the edit menu
2. the actual comand buttons (the toolbar buttons)
3. ctr c etc
4. right click options.
My prombem is that I get a runtime error 5 saying that this is an
invalid proceedure.
Any help on the bug here would be appreciated.
Thanks
Tim
Private Sub Workbook_Activate()
Application.CommandBars("Standard").Controls("Cut").Delete
Application.CommandBars("Standard").Controls("Copy").Delete
Application.CommandBars("Standard").Controls("Paste").Delete
Application.CommandBars("Formatting").Controls("Cut").Delete
Application.CommandBars("Formatting").Controls("Copy").Delete
Application.CommandBars("Formatting").Controls("Paste").Delete
Application.CellDragAndDrop = False
Application.CutCopyMode = False
Application.OnKey "^X", ""
Application.OnKey "^C", ""
End Sub
Private Sub Workbook_Deactivate()
Application.CommandBars(1).Reset
Application.CellDragAndDrop = True
Application.CutCopyMode = True
Application.OnKey "^X", "^X"
Application.OnKey "^C", "^C"
End Sub