+ Reply to Thread
Results 1 to 12 of 12

Disable Cut, Copy, Paste in a workbook

  1. #1
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Smile Disable Cut, Copy, Paste in a workbook

    Dear Friends,

    I got the following code (which disables the cut, copy, paste in a workbook) in this forum only. Thanks to the author. It works nicely. I applied the code as follows:

    In workbook module:
    Please Login or Register  to view this content.
    In general module:
    Please Login or Register  to view this content.
    It disables shortcuts (Ctrl+x, Ctrl+C, etc) only. But, how to disable these commands in Menu control also?

    Thanks in advance.

    acsishere.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Your code disables all the copy options, what it doesn't do is re-enable it.

    Please Login or Register  to view this content.


    [/CODE]
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Smile Dear Sir,

    Thanks for your immediate reply.

    I applied the code in the workbook. I don't understand how to apply it in the workbook. I copied Sub DisablecutAndPaste(), Sub EnablecutAndPaste() & Sub Error() into general module.

    Besides, I copied the Sub WorkbookOpen() into ThisWorkbook module.

    It doesn't disable the MENU COMMANDS (in Edit Menu). What is wrong in this code?

    Thanks in advance.

    acsishere.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    The code is all in this workbook
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Smile Dear Sir,

    Thanks for the clear reply. But still it only disables the shortcuts. I need both shortcuts & Edit Menu commands (only cut, copy, paste, pastespecial) are also to be Disabled.

    Thanks in advance.

    acsishere.

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Cut, Copy & Paste are disabled from the Edit Menu

  7. #7
    Registered User
    Join Date
    11-22-2007
    Posts
    60
    Thought this might be useful for something I have planned so I downloaded the workbook from royUK.

    I get the following error when opening

    Run-time error'-2147467259 (80004005)':

    Method 'Enabled' of objec'_CommandBarButton'failed
    Clicking debug highlights this

    Please Login or Register  to view this content.
    Some of the functions are disable but not all of them.

  8. #8
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Smile Dear Mr. Roy,

    Sir, I am using Office 2007. As I mentioned earlier, the Edit Menu functions are still working.

    But you mentioned that it is disabled. I adopted the code as you described. Still where I am committing mistake?

    Thanks in advance.

    acsishere.

  9. #9
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Excel 2007 is totally different, it doesn't have Commandbars so you would need to customise the Ribbon.

  10. #10
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Smile Dear Sir,

    Thanks for the clarification. Of course, temporarily I am doing with customizing the ribbon only. But the permanent solution? Any possibility to maintain compatibility thru VBA. Because, the data entry is done in Excel versions 97 - 2007.

    Thanks a lot.

    acsishere.

  11. #11
    Registered User
    Join Date
    10-09-2011
    Location
    Jurong, Singapore
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Disable Cut, Copy, Paste in a workbook

    I copied the macro from link:
    http://www.excelforum.com/excel-prog...-workbook.html.
    Suppose to disable the copy & paste function for one workbook only.
    The problem is all my excel workbook now have lost the copy & paste function. I have delete the macro and the worbook still I have not recover the copy & paste function.
    Please help me.

  12. #12
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Disable Cut, Copy, Paste in a workbook

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1