+ Reply to Thread
Results 1 to 13 of 13

Protect workbook from copying by any way.

  1. #1
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Protect workbook from copying by any way.

    For sure it's an issue that discussed many times and perhaps will be in the future.

    I know that there are many articles for this but as my English are not very good and my VBA skills are also not good, it's difficult to follow all these articles. So my question is:

    How can we prevent a non advanced user to copy excel files from the computer that works?

    In other words how can prevent him(her) to copy files in stick(his(her) own disk)? How can we prevent to mail these files?

    Thanks in advance for any idea.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Protect workbook from copying by any way.

    are you trying to prevent the files from working on any machine apart from a specific one, or trying to prevent them from being used outside your network or what?

    generally vba is not going to be a good solution in my opinion-network security and company policies will be better
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Protect workbook from copying by any way.

    You are looking at a non excel/vba solution to prevent a user from copying and pasting a file. You don't need to open excel for this.

    However, you might find it better to prevent the file from opening if it has been moved/copied -this can be sort of achieved in VBA. You need to use a method to get macros enabled (e.g. splash screen method), depends on your definition of "non-advanced" user as to whether this would be sufficient. You could then test for all sorts of things to determine whether the file should open:
    -Directory it is saved in
    -Machine/MAC number it is being run on
    -Network connection
    -Registry key

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Protect workbook from copying by any way.

    .. or trying to prevent them from being used outside your network or what?
    I want to prevent them(in simple English..) to take my files out of my Office!

    @ yudlugar

    As i said my English are not good. I understand almost mothing of what you say. Sorry for this.

  5. #5
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Protect workbook from copying by any way.

    do they need to use your files in your office? if not I suggest you just password protect them

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Protect workbook from copying by any way.

    These are files for my business. The people that i want to prevent are my employees. I need to work with these files in the office but i am looking for a way to prevent them to take these files out of my business!

    Example: Maybe there is a way the files to open only in specific computers... Just an idea..

  7. #7
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Protect workbook from copying by any way.

    I use this to limit files to being opened when connected to my network:
    Please Login or Register  to view this content.
    You need to change the network name as appropriate and run it as a workbook_open event. Obviously this can be circumvented by disabling macros...

    For limiting to specific computers I use the mac number, which you can get with something like (again not my code)
    Please Login or Register  to view this content.
    Again, you probably need to tweak it slightly to account for the different mac numbers you can pick out, I use it as a function to test whether the mac number in a license file exists in the ipconfigset on the users computer

  8. #8
    Forum Contributor
    Join Date
    03-14-2012
    Location
    location
    MS-Off Ver
    Excel 2007
    Posts
    170

    Re: Protect workbook from copying by any way.

    yudlugar's solution is much better that this one...
    I found this code here, it's very useful.
    In your workbook add a sort of passowrd in any cell you want, let's say in cell H100, sheet1.
    File Bo1.xls is a file located somewhere in yr pc, and in Sheet1, cell A100 has the same "password" you added in yr workbook.
    of course, is not for advanced users, they can disable the macros and read the "protection".

    in ThisWorkbook
    Please Login or Register  to view this content.
    blue

  9. #9
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Protect workbook from copying by any way.

    @ yudlugar

    What is mac number?

    Using your second suggestion, do i need to use this code in every computer that i want?

    @ blue.chio

    Let's see if i understand....

    I have let's say a workbook calling File Bo1.xls in a folder somewhere in c/drive.. In a worksheet(let's say sheet1) in cells A100 & H100 i need to put a password? I don't see in code that you provided any reference to password..

  10. #10
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Protect workbook from copying by any way.

    http://en.wikipedia.org/wiki/MAC_address

    It's basically a number associated with your hardware which you can't change (at least easily).

    There are few possibilities how to use it, you could have a list of mac numbers of which the file is allowed to open for:
    Please Login or Register  to view this content.
    I do it by having a text file I use a license with the MAC number for the machine encoded into it, I then extract the mac number from the text file and compare it to what that function gives me.

    The reason for doing it this way is I have many copies of the workbook all over the network, so if I want to add a computer to it and I have hard coded the allowable mac numbers into the workbook it would only happen on "new" versions.

  11. #11
    Forum Contributor
    Join Date
    03-14-2012
    Location
    location
    MS-Off Ver
    Excel 2007
    Posts
    170

    Re: Protect workbook from copying by any way.

    Hello Fotis,

    You have a workbook that you want to be used by you/your colleagues from yr office only called Fotis_file.xls
    - create a new file called whatever you want, let's say Bo1.xls. In this file, sheet1, cell A100 enter a value. (change the text color in white )
    - in your file called Fotis_file, sheet1, cell h100 add the same value you entered in Bo1 file (sheet1, cell A100).
    the code cjecks the values, if they matched the file (yr file) will be opened, else not.
    the second piece of code will check the computer name, if is not yours, the file is not opened....

    blue

  12. #12
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Protect workbook from copying by any way.

    @ yudlugar

    As i am not a computer man(i just love excel) and use computers only for my job, i'll call my computer technicial to try it together..Probably tomorrow..

    Thank you for your effords. I don't close this thread and i'll let you know.

  13. #13
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Protect workbook from copying by any way.

    Blue. Thank you for the explanations. I'll try it and i let you know!

+ 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