+ Reply to Thread
Results 1 to 7 of 7

Prevent copying a READ-Only?

  1. #1
    Registered User
    Join Date
    04-11-2007
    Posts
    82

    Prevent copying a READ-Only?

    I have a very important file, and with the help of the users on this site was able to protect the heck out of it. However, I have found a flaw in my plan. Even with all the passwords and readonly access, users can still copy the sheet and paste onto a new book, thus allowing them re-write access...

    Does anyone know how I can prevent this book from being copied? (By all users but admin of course)

    Thanks!!

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885
    Hello Mitelkm,

    The following code taken from http://www.ozgrid.com/VBA/disable-cut-copy.htm should work for you. They utilize your Workbook Activate, Deactivate and SheetSelectionChange events (paste this code into the ThisWorkbook module of your workbook):
    Please Login or Register  to view this content.
    I added the sections in green/blue to also capture any CTRL+C (copy) and CTRL+X (cut) keyboard commands.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Maybe this?
    Please Login or Register  to view this content.

  4. #4
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885
    You may also want to add this to the Workbook_Activate macro:
    Please Login or Register  to view this content.
    and this to the Workbook_Deactivate macro:
    Please Login or Register  to view this content.
    This disables/enables the 'Move or Copy...' command when you right-click on a worksheet tab. The original code I provided, as well as shg, does not prevent this method of copying the sheet(s).

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    This link may also be of interest

    http://www.excelforum.com/showthread.php?t=624239

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  6. #6
    Registered User
    Join Date
    04-11-2007
    Posts
    82

    Thanks!!!!

    You Guys are Geniuses I tell ya!! Just Genius!.


    Thanks sooo much.....


    I love this site. I can always find someone willing to answer my questions and solve my dilemmas!!!

  7. #7
    Registered User
    Join Date
    01-28-2013
    Location
    Thailand
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Prevent copying a READ-Only?

    This work perfectly fine!
    Thank you very much, Paul!

+ 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