Add restrictions to copy/cut/paste in Excel when a worksheet is protected

Office Version:  Office 2007;
Operating System:Windows 7; 
Program:Excel
I need to be able to select via a macro or some other way the restrictions listed below on copy/cut/paste.  The worksheet will be protected. 
The goal is to allow a user to have the capability to type in data or copy-paste-values only in the unlocked cells.  I wish to block a user from changing the formatting or pasting a formula in an unlocked cell via copy or
cut and paste.  This is necessary to maintain the worksheet/workbook integrity when multiple users have access to it.
1.    
 Disable cutting from unlocked cells
2.    
Allow ONLY copy/paste value from any cell to any unlocked cell.   
The user needs to be able to select locked cells.
Ideally, the user can copy-paste-values from that locked cell an an unlocked cell.  The ability to copy from the locked cell is not an absolute need but being able to
select the locked cell is very important due to the large size of the worksheet.
The locked cells will have their formulas hidden.
I entered the question in the website below but received no feedback.  The Microsoft tech support group said I should contact this IT Pro forum.
http://answers.microsoft.com/en-us/office/default.aspx#tab=1
Thanks

Unfortunately it is not easy; there are lots of individual items to deal with.
You can use Application.OnKey to disable (or repurpose) the key combinations (e.g. Ctrl+X, Ctrl+V, Shift+Del, Shift+Insert ) that you don't want used.  Typically you would do this in Workbook_Open and reverse it in Workbook_BeforeClose (and you need to
save the workbook if necessary within Workbook_BeforeClose to prevent the user from cancelling the Save Changes message after your code has done its work).
In Excel 2003 you could use VBA to disable or make invisible the menu items and toolbar buttons that would do actions you didn't want the user to be able to carry out.  But in 2007 you have to write XML using the custom UI editor and save it in the
XLSM file.  A good site for information on how to work with the ribbon in 2007 is
www.rondebruin.nl
If you get most of the way there and get stuck on some point, do come back.
It would be good if MS extended the protection model to prevent cut and pasting other than values - it is a common requirement.  I will go now and make that suggestion to the developers.
Bill Manville. Excel MVP, Oxford, England. www.manville.org.uk

Similar Messages

  • Edit menu - allowing copy/cut/paste

    I am working on creating an edit menu and I would like to be able to disable the copy/cut/paste items in the menu when their use is not possible (like when there is no text based field to copy from).
    I am guessing that one approach I can take is as follows:
    1) Determine what component currently has focus, and whether it is a text field. If it is not a text field, then all three of the menu items should be disabled.
    2) If it is a text field and there is a selection, enable the copy and cut menu items.
    3) If it is a text field and there is an insertion point, then enable paste.
    However, I have no idea how to accomplish any of those three step. Or even if that is the right approach. Also, I would like to implement the listener within my edit menu class itself (a subclass of JMenu), since I use it to insert edit menues into a number of different JFrames. I would appreciate any help or direction. Thanks.

    Woops! I see you want multiple windows. Here a redo with a frame & a dialog
    import java.awt.*;
    import java.beans.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.text.*;
    public class PasteAction extends AbstractAction {
        public PasteAction(final Window window) {
            super("Paste");
            setEnabled(false);
            putValue(MNEMONIC_KEY, new Integer('P'));
            putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.CTRL_DOWN_MASK));
            putValue(SHORT_DESCRIPTION, "blah blah");
            //putValue(SMALL_ICON, icon);
            KeyboardFocusManager man = KeyboardFocusManager.getCurrentKeyboardFocusManager();
            man.addPropertyChangeListener("permanentFocusOwner",
                new PropertyChangeListener(){
                    public void propertyChange(PropertyChangeEvent evt) {
                        KeyboardFocusManager man = (KeyboardFocusManager) evt.getSource();
                        if (window.equals(man.getFocusedWindow())) {
                            Component comp = man.getPermanentFocusOwner();
                            setEnabled(comp instanceof JTextComponent);
        public void actionPerformed(ActionEvent e) {
            Component comp = getFocusedComponent();
            if (comp instanceof JTextComponent)
                ((JTextComponent)comp).paste();
        public static Component getFocusedComponent() {
            KeyboardFocusManager man = KeyboardFocusManager.getCurrentKeyboardFocusManager();
            return man.getPermanentFocusOwner();
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class ActionTest {
        public static void main(String[] args) {
            JFrame f = new JFrame("ActionTest");
            createContent(f);
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.pack();
            f.setLocation(0,0);
            f.show();
            JDialog d = new JDialog(f, "dialog");
            createContent(d);
            d.pack();
            d.setLocation(f.getWidth(),0);
            d.show();
        static void createPanel(RootPaneContainer rpc) {
            Container panel = new JPanel(new GridBagLayout());
            GridBagConstraints gbc = new GridBagConstraints();
            gbc.fill = GridBagConstraints.HORIZONTAL;
            for(int y=0; y<10; ++y) {
                gbc.gridy = y;
                gbc.gridx = 0;
                panel.add(new JTextField("field " + y, 20), gbc);
                gbc.gridx = 1;
                panel.add(new JButton("button " + y), gbc);
            rpc.getContentPane().add(panel);
        static void createMenuBar(RootPaneContainer rpc, Action action) {
            JMenuBar mb = new JMenuBar();
            JMenu menu = new JMenu("Edit");
            menu.setMnemonic('E');
            menu.add(action);
            mb.add(menu);
            rpc.getRootPane().setJMenuBar(mb);
        static void createToolBar(RootPaneContainer rpc, Action action) {
            JToolBar tb = new JToolBar();
            tb.add(action);
            rpc.getContentPane().add(tb, BorderLayout.NORTH);
        static void createContent(RootPaneContainer rpc) {
            createPanel(rpc);
            PasteAction paste = new PasteAction((Window)rpc);
            createMenuBar(rpc, paste);
            createToolBar(rpc, paste);
    }

  • Copy and Paste from Excel to Applet

    Hi,
    I'm having a problem with trying to copy and paste data from Excel to an Applet (JTable). The copy and paste works fine when I run the standalone applet, but when it's embedded into a HTML page and placed in an app server, it would not recognize what's on the clipboard, so nothing gets pasted. Any ideas?
    cheers,
    Andrew

    My guess is that you get an security exception. An applet has to by signed to enable cut & paste with excel.
    For more info on signing applets: http://personal.vsnl.com/sureshms/javasign1.html

  • Tried to paste a resume and i get this as a answer (copy/cut/paste is not available in mozilla and firefox ?

    i have a mac pro and i copied a pdf form resume to a site
    called local work.ca and tried to paste it and this
    is what showed up as a answer (copy/cut/paste is not available
    in mozilla and firefox
    i have firfox 6.0.1 can you help me please

    *http://kb.mozillazine.org/Granting_JavaScript_access_to_the_clipboard
    *https://addons.mozilla.org/firefox/addon/allowclipboard-helper/ - AllowClipboard Helper

  • Suddenly I cant copy and paste copy/cut/paste is not available in Mozillia and firefox. Never seen this before

    I have never seen this before when I try to copy and paste, I get a
    "Copy/cut/ paste is not available in Mozilla and firefox. Do you want more information about this issue? "
    I have copied and pasted hundreds of times before with Mozilla and firefox . This just happened suddenly.
    when I go to find more information on this issue, it give a long drawn out explanation I cant follow.
    What happened?

    When you right-click the link, the page immediately tells you you can't copy, or does that occur after you choose Copy Link Location?
    If it appears immediately, you can switch a setting in Firefox that should prevent sites from blocking the normal right-click menu. Here's how you would do that:
    (1) In a new tab, type or paste '''about:config''' in the address bar and press Enter. Click the button promising to be careful.
    (2) In the search box above the list, type or paste '''context''' and pause while the list is filtered
    (3) Double-click the '''dom.event.contextmenu.enabled''' preference to switch it from true to false.
    This setting does have a complication: On Google Maps and other sites that have their own right-click menu, Firefox's menu then will block the site's menu. To clear Firefox's menu so you can access the site's menu tap either the Alt key or Esc key once (but sometimes Esc removes both).

  • Firefix sad:"Copy/Cut/Paste is not available in Mozilla and Firefox. Do you want more information about this issue?" But,I can do the that from Opera...What should I do?

    Copy/Cut/Paste is not available in Mozilla and Firefox.
    Do you want more information about this issue?
    That's what Firefox sad to me...I was Rich text editing,but I can
    not use copy paste on.
    I did the same site and Rich text editing with Opera,
    and there was no problem.
    I love Firefox,and I want ti use it,but if this is not posibile to do in Firefox,I must go with Opera from now on.
    Pleace,responde to me,I need to fix a problem.
    I hope you understanded my Engish!
    Thank you...

    Try to use the keyboard if the buttons on the web page aren't working.
    * Copy: Ctrl+C or Ctrl+Insert
    * Paste: Ctrl+V or Shift+Insert
    * Cut: Ctrl+X or Shift+Delete
    See:
    *http://kb.mozillazine.org/Granting_JavaScript_access_to_the_clipboard
    *https://addons.mozilla.org/firefox/addon/allowclipboard-helper/

  • Copy/Cut/Paste is not available in Mozilla and Firefox. Do you want more information about this issue?

    Copy/Cut/Paste is not available in Mozilla and Firefox.
    Do you want more information about this issue?
    Yes!

    https://support.mozilla.com/en-US/kb/Clipboard+not+working
    This extension will help you set the necessary permissions - Allow Clipboard Helper extension: <br />
    https://addons.mozilla.org/en-US/firefox/addon/852

  • [SOLVED]Cannot copy/cut/paste files in Konqueror

    Hi all, I am using KDE4.1.2 (official version). My konqueror cannot copy/cut/paste files in 'file manager' mode, the copy/cut/paste items in the right click menu are always faded out, and C-x/C-c/C-v hotkeys do not work either. However, it can read/write/rename/delete files normally. In fact, 'Move to' and 'Copy to' menu works too. Meanwhile, dolphin does not have this problem. I am a little confused.:mad:
    Last edited by hk2717 (2008-10-08 01:35:56)

    Hello,
    I'm using kdemod, konqueror 4.1.4 in i686, and the paste is always greyed out (same happens with the button in the taskbar). The "copy" action seems to be enabled through ctrl-c and the right-click, but there is no way to say, because no paste can be done. Deleting files works, so it does not seem to be related to permissions.
    Regarding the post
    http://bbs.archlinux.org/viewtopic.php?id=57749
    I installed konq-plugins, but it did not help. The paste is also greyed out in dolphin.
    I wonder if anyone is having this same issue? I thought this was solved in 4.1.3
    Thanks!
    Eduardo

  • ATT: Apple - Adding "copy/cut & paste" soon??

    Attention Apple:
    Any plans on ADDING the "copy/cut & paste" feature into the iPod soon??
    It's getting ridiculous that it's been so long and after many reviews from various tech magazines and other reviews that the "copy/cut & paste" feature is still NOT available!
    Yeah, yeah, Apple users probably do NOT make any mistakes typing but PC users actually Do! That's still also a problem with Mac computers in that it does NOT offer an easier way of using the "copy/cut & paste" feature since the Mac computers doesn't offer a dual button mouse, but must use the keyboard shortcut instead!
    It makes life simpler when texting!!
    Thank you!

    I've been using a 5 button Microsoft mouse on every iMac I've owned (going back to a 1999 iMac G3 with OS 9) - I hate the shape of Apple mice and Microsoft ones work without any drivers needed on OS X. 
    Apple has been selling 4 button mice (left, right, squeeze, and scroll ball click) for years and they've been standard in the box for quite some number of years too.
    Cutting and pasting is easier on a Mac because Expose allows much more rapid shifting between windows and dialogues than Windows does (I endure WinXP for around 7 hours everyday at work).
    I absolutely agree that Cut and Paste needs to be added to +iPhone/iPod touch+ and I have left feedback on several occasions accordingly:
    http://www.apple.com/feedback/ipodtouch.html
    Let's keep our fingers crossed
    kind regards
    mrtotes

  • Can't copy, cut & paste.

    I just bought an HP TouchSmart520 PC & am trying to figure out how to copy, cut & paste. Clicking on the R mouse doesn't even have it as an option. Please help!

    Hi,
    Have you tried to use the keyboard ?
      Hold down the Ctrl key then (a) Pres C for Copy and (b) Press V for Paste
    If you wish to you Right click mouse (normally) you have to hightlight the area you want to copy first.
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • Why did apple mail get much worse with lion osx?  I can't add recipients without copy and paste?

    why did apple mail get much worse with lion osx?  I can't add recipients without copy and paste?

    I went through updates on my three newest Macs this week.  As I stated I'm talking about iTunes 10.5.1 (42).  I am checking for updates now and I see 10.5.2 is now available.  I'll know in about 15 minutes if this issue is fixed or not.
    15 minutes later:
    I must have updated this PPC G5 a day or two before iTunes 10.5.2 came out.  I was able to update to 10.5.2 (11) and this copy/paste bug is fixed.  I'm happy again.
    Tracy

  • Copying and pasting adjustments.  When I copy the adjustments of an image, I thought I could then select several images and batch paste the adjustments to all selected images. But instead it's only pasting to the first photo of the selection. What am I do

    Copying and pasting adjustments.  When I copy the adjustments of an image, I thought I could then select several images and batch paste the adjustments to all selected images. But instead it's only pasting to the first photo of the selected. What am I doing wrong?

    Copy and Paste develop settings in Develop mode on multiple photos on the film strip works for me, even with Auto-Sync turned off.  Lr5.6 OSx 10.8.5

  • Customizing copy/cut/paste of JTextPane

    Hello,
    i'm using a JTextPane with its methods cut,copy and paste.
    I use HTMLDocument with this pane.
    When i copy and paste a portion of text in a cell of a table, this cell is also copied.
    Then i wrote a copy method which only copy text, but styles are lost...
    Then i would like to copy text and all the leaf elements associated to the text (that could allow me copying pictures :)
    Can I create a class which implements Transferable interface to make a copy?
    If yes, How do i do with DataFalvor (these classes are in java.awt.datatransfer package)?
    Thanks in advance.

    Hello,
    I followed the link to your site and it looks like some very useful stuff. What are the licensing arrangements for using this source code? Any fees, restrictions, other issues? thanks very much for the information.
    - Sue

  • Copy, Cut, Paste

    Hi,
    How can I implement cupy, cut and paste in actionscript. Basically, I have 3 buttons that I want to use to trigger those actions.
    Thanks in advance.

    Are you going to run this from an AIR application, or from the Flash Player in a browser? In the latter case, there are security restrictions that prevent you from accessing the clipboard unless the browser has detected a user request for Cut, Copy, or Paste (e.g., a menu hit). In an AIR application, these restrictions are not an issue.
    I'd suggest looking at the TextScrap and TextClipboard classes as well as the EditManager. The TextClipboard has basic functions for getting content to and from the system clipboard. The TextScrap is a data structure used for copy & paste that's essentially a snippet of text from within a TextFlow.
    For Copy, you can do a CopyOperation, or you can just do this:
                    TextClipboard.setContents(TextScrap.createTextScrap(selectionState));      
    The selectionState indicates the range of text to be copied.
    For Paste or Cut, easiest way is through the EditManager, assuming your textFlow's interactionManager is an EditManager:
                   EditManager(textFlow.interactionManager).pasteTextScrap(TextClipboard.getContents());
    and
                   TextClipboard.setContents(EditManager(textFlow.interactionManager).cutTextScrap());      
    Hope this helps,
    - robin

  • Copy and paste from excel to adobe form

    Hi everyone,
    a customer in a project based on WDJ + Adobe Interactive Form asks us the ability to copy areas of data (numeric and alphanumeric) from an Excel Spreadsheet (set of contiguous rows and columns), and paste them into a text field free PDF, preserving the formatting (ie the structure of rows and columns, font and size).
    Personally I think it is something not feasible unless a development at hoc.cosa do you think?
    Any advice is very welcome.
    Regards,
    Mirco

    Reading the documentation XFA at http://partners.adobe.com/public/developer/en/xml/xfa_spec_3_1.pdf (richtext reference) we understand that you can make the cut & paste from Word or, better still from a RTF. But in this case from the Excel table information is lost as it is aligned in a single line.
    The only way I think is to define a common layout to Excel and Adobe and use tables dynamically in the form
    I do not think this is a limitation of the SAP solution!
    regards,
    Mirco

Maybe you are looking for

  • IPod classic not recognised in iTunes

    When I try and connect my iPod classic with latest iTunes it comes up with an error message "Mac OS X can't repair the disk JO IPOD" it's also not registering in my iTunes. Do I need to reformat my iPod? If so, how do I do this when it's not showing

  • I can change the language of pages 5.5.1 to catalan?

    Hello everyone, I want to know how I can change the language of pages 5.5.1 to catalan? since I live in Barcelona and I need it. greetings, Sergio Garcia Rodriguez

  • Charging and using the Ipod at the same time

    I have a MAC and my Ipod is formatted for MAC. While the Ipod is plugged in to the MAC with the USB cable, I can eject it and use the Ipod while it is charging. At work, I plug the Ipod in to a Windows machine. It mounts although it is not formatted

  • IPhoto: Export videos with titles

    All of my videos are in iPhoto, and I've added titles to all of the videos within iPhoto. However, when I EXPORT these videos to my desktop, iPhoto doesn't export them with the titles that I've assigned to them in iPhoto. iPhoto exports them with the

  • Using a JSlider to change JLabel background

    I have set up a JSlider to change the opacity of a JLabel's background. I have found that the only way to make the change take effect, is to toggle the visibility of the JLabel in the stateChanged method. Why is this? Shouldn't just setting the JLabe