Useful
Active Member
- Joined
- Mar 16, 2011
- Messages
- 494
Hi mr excel!
This time i want to ask a question about how to disble the sheet from "move or copy" and also dragging with help left click of mouse to creat copy?
I find this two codes below:
I-First code; this code protects to insert new sheet with "Shift+F11" and From the menu bar "Insert worksheet"
II. Second code; helps to disable the tab menu bar (on right click).
also hides menu bar
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.CommandBars("Worksheet Menu Bar").Enabled = True
Application.CommandBars("Sheet").Enabled = False
Application.CommandBars("Ply").Enabled = False
End Sub
But still i have problem -that users can creat new sheets with "Ctrl+left click on mouse then dragging and new sheet already created
Now i want to disable all of possibility to creating a new sheets
have any idea?
Thanks in advance!
This time i want to ask a question about how to disble the sheet from "move or copy" and also dragging with help left click of mouse to creat copy?
I find this two codes below:
I-First code; this code protects to insert new sheet with "Shift+F11" and From the menu bar "Insert worksheet"
Code:
Private Sub Workbook_NewSheet(ByVal Sh As Object)
With Application
.DisplayAlerts = False
.ScreenUpdating = False
End With
Sh.Delete
With Application
.DisplayAlerts = True
.ScreenUpdating = True
End With
MsgBox "You can't to insert new worksheet"
Application.CommandBars("Ply").FindControl(, 945).Enabled = False
End Sub
also hides menu bar
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.CommandBars("Worksheet Menu Bar").Enabled = True
Application.CommandBars("Sheet").Enabled = False
Application.CommandBars("Ply").Enabled = False
End Sub
But still i have problem -that users can creat new sheets with "Ctrl+left click on mouse then dragging and new sheet already created
Now i want to disable all of possibility to creating a new sheets
have any idea?
Thanks in advance!
Last edited: