Maybe i didn't wrote my question right ...
I need to disable "Move or Copy" on right click menu on sheet name.
I know that is posible to disable copy and /or cut on cells right clic
menu but i don't know how to refer to right click on sheet name
Application.CommandBars("Ply").Controls("move or copy...").Enabled = False
or
Application.CommandBars("Ply").Controls("move or copy...").Visible = False
It's nice to turn it back when you're done (when you close your workbook).
Don't forget to stop
Edit|move or copy sheet...
And any other toolbars that the user has created--or any macro that they've
created...
or just dragging (or controlclick and drag) to move/copy.
(Sounds like a problem to me.)
And I was answering the move/copy sheet--I didn't mean copying the cells (in
that first post).
If I understand you correctly then perhaps something like this......
Code
-------------------
Sub AsAdsAds()
DisableMoveCopy True
End Sub
Sub DisableMoveCopy(blnState As Boolean)
Dim Combar As CommandBar
Dim ComBarCtrl As CommandBarControl
On Error Resume Next
For Each Combar In Application.CommandBars
Set ComBarCtrl = Combar.FindControl(ID:=848, recursive:=True)
If Not ComBarCtrl Is Nothing Then
ComBarCtrl.Enabled = blnState
End If
Next
Set ComBarCtrl = Nothing
End Sub
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.