ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Disable "Move or Copy sheet "action (https://www.excelbanter.com/excel-programming/395517-disable-move-copy-sheet-action.html)

armaSANEA

Disable "Move or Copy sheet "action
 
Hello,

I need to find a way to disable certain Excel functions, like the Move or
Copy sheet action. I would like to ask for some good advice on how to do this.

Also, although I understand this is highly unlikely, but is there any way to
control the parameters shown in the Move or Copy form? (from Edit -- Move or
Copy sheet). Is there ay way to remove the item "(new book)" from the "To
Book" dropdownlist?

If not, perhaps I could disable the dropdownlist altogether? This way moving
or copying could be done only within the current workbook.


Thanks for reading!


Michael

Disable "Move or Copy sheet "action
 
'This command will remove not really delete the Move or copy sheet from the
edit bar
ThisWorkbook.CommandBars("Edit").Controls(13).Dele te
'This command will disable the right click version of moving or copying the
sheet
Set modfctrl = CommandBars(35).FindControl(ID:=848)
With modfctrl
If .ID = 848 Then
.Enabled = False
End If
End With
To Restore into main edit bar do this:
Application.CommandBars("Edit").Controls.Add Type:=msoControlButton, ID:= _
848, Befo=13

To restore on right click:
Enabled = True

If this posting is helpful please click on the yes button. Thank you

Michael Arch

"armaSANEA" wrote:

Hello,

I need to find a way to disable certain Excel functions, like the Move or
Copy sheet action. I would like to ask for some good advice on how to do this.

Also, although I understand this is highly unlikely, but is there any way to
control the parameters shown in the Move or Copy form? (from Edit -- Move or
Copy sheet). Is there ay way to remove the item "(new book)" from the "To
Book" dropdownlist?

If not, perhaps I could disable the dropdownlist altogether? This way moving
or copying could be done only within the current workbook.


Thanks for reading!



All times are GMT +1. The time now is 01:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com