PDA

View Full Version : Disable Cut Copy Paste in Excel 2007



marzook
03-15-2009, 10:30 AM
How to Disabel Cut copy paste button in Excel 2007 from Home tab

Paul_Hossler
03-23-2009, 12:55 PM
You can use the CustomUI editor to disable controls


<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<!-- *********************************************************************-->
<!-- **********Disable and Repurposing controls on the ribbon*************-->
<!-- *********************************************************************-->
<!-- *You can find the Control names in one of the downloads on this page*-->
<!-- ***************http://www.rondebruin.nl/ribbon.htm*******************-->
<!-- *********************************************************************-->
<commands>
<command idMso="Cut" enabled = "false" />
<command idMso="Copy" enabled = "false"/>
<command idMso="Paste" enabled = "false"/>
</commands>
</customUI



Paul

Ken Puls
04-30-2009, 03:01 PM
I know this is a little late, but just a caveat here. Modifying the XML via the customUI editor will disable the commands on the ribbon and the right click menus, but it won't disable the keyboad shortcut to do the task. (i.e. CTRL+C still copies and CTRL+V still pastes.)

If you want to remove the ability to do copy/paste completely, you'll need to craft some code to overrule the keyboard shortcuts. This KB article (http://www.vbaexpress.com/kb/getarticle.php?kb_id=373) does still work in 2007, although it does have some extra overhead that isn't needed to control the (old) menus.

Paul_Hossler
04-30-2009, 08:12 PM
Hi Ken -- haven't seen you in the forum for awhile

Paul

Ken Puls
05-01-2009, 08:57 AM
Yeah, I know. Been very busy offline writing, teaching and trying to keep up with the emails through my site. That and balancing off with family life of course.

I'm hoping to pop in a little more frequently. ;)

FoxProUser
05-08-2009, 12:47 PM
I am trying to add this code to the disable copy and paste code from the KB article. Where does this go? I know that you said the Custom UI Editor. However, I'm not finding that under the VBA area.

thanks!















You can use the CustomUI editor to disable controls


<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<!-- *********************************************************************-->
<!-- **********Disable and Repurposing controls on the ribbon*************-->
<!-- *********************************************************************-->
<!-- *You can find the Control names in one of the downloads on this page*-->
<!-- ***************http://www.rondebruin.nl/ribbon.htm*******************-->
<!-- *********************************************************************-->
<commands>
<command idMso="Cut"enabled = "false" />
<command idMso="Copy"enabled = "false"/>
<command idMso="Paste"enabled = "false"/>
</commands>
</customUI


Paul

Ken Puls
05-11-2009, 09:11 PM
Hi FoxPro,

The CustomUIEditor is a separate download used to modify the XML required to architect a solution for the Office 2007 ribbon. The code you quoted is not VBA, it's XML, which is the language used in the Office 2007 OpenXML file format.

You can download the CustomUIEditor here (http://openxmldeveloper.org/articles/customuieditor.aspx).