+ Reply to Thread
Results 1 to 6 of 6

Preventing people from opening developer mode, cut and paste or even deleting workbook

  1. #1
    Registered User
    Join Date
    05-29-2014
    Posts
    2

    Preventing people from opening developer mode, cut and paste or even deleting workbook

    Hi,

    My excel workbook contains info that I want to let selected people see and it's stored in the office servers. Basically, no one should be able to print, save or delete the whole workbook and any of its content. But, others (who have the password to open the workbook) have been copying and pasting the workbook onto other drives/their own PCs and some of them have even deleted the file.

    I have inserted a code in the VBA mode that prevents "save" or "save as" via the design mode and protected all the VBA projects with a password. The sheets are also protected from copy and paste of the cells. However, it seems that anyone who knows how to open the design mode will be able to "save as/save" making my VBA code useless.

    By opening in design mode, they can choose "save as" and still save the workbook onto their computers

    I was wondering if you guys know way that
    1. Prevents deletion of my entire workbook
    2. Prevents cut/copy and paste of the workbook
    3. Runs a code, preventing design mode from being accessed in others' computers.
    4. Makes sure that where the location that they open the workbook from is not changed (i.e. not copied location)

    Thank you for taking the time to look through this long message and I would really be grateful for any help at all!!

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Preventing people from opening developer mode, cut and paste or even deleting workbook

    Sadly, your VBA Code IS useless. All they have to do is open the workbook without enabling macros and there is no protection at all.

    Excel is not a secure environment. If your data is sensitive or the workbook contains your Intellectual Property, you cannot rely on Excel security or VBA to protect it.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    05-29-2014
    Posts
    2

    Re: Preventing people from opening developer mode, cut and paste or even deleting workbook

    Managed to find a code that forces them to open macros in order to view other (hidden) sheets. I've tried this and it prevents printing, copying and pasting a cell.

    Please Login or Register  to view this content.
    But when i tried to add in a "no save" function, it gives a compile error (Ambiguous name detected: Workbook_Open)

    :/
    This was what I added to the end of the above code to disable the saving function:

    Please Login or Register  to view this content.
    Funny thing is that when I paste on a new workbook, it works!

  4. #4
    Valued Forum Contributor
    Join Date
    11-26-2012
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    419

    Re: Preventing people from opening developer mode, cut and paste or even deleting workbook

    You can't really stop someone who knows what they are doing from doing these things, but you can make it inconvenient.

    1. Prevents deletion of my entire workbook
    This can't be controlled by Excel or VBA - you'd have to talk to your network administrator about access rights.


    2. Prevents cut/copy and paste of the workbook
    This can be done - code below:

    Put this into ThisWorkbook
    Please Login or Register  to view this content.
    and this into a standard module
    Please Login or Register  to view this content.

    3. Runs a code, preventing design mode from being accessed in others' computers.
    Don't think this is possible.

    4. Makes sure that where the location that they open the workbook from is not changed (i.e. not copied location)
    You can add something like this to Workbook_Open (the reason you are getting the Ambiguous name detected error is your code has two Workbook_Open sections - you can only have one.)

    Please Login or Register  to view this content.
    In addition to doing this, you should hide all sheets (except one that says you have to enable macros) on close, so that when opened, if macros are not enabled, nothing in the spreadseet is visible, except the message that you need to enable macros. If macros are enable, unhide all sheets and hide the one that says macros have to be disabled.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Preventing people from opening developer mode, cut and paste or even deleting workbook

    You already have a workbook open event in the code you found to "force users to enable macros". You need to combine the two lines of code in the second version with the first.

    I don't want to rain on your parade, but it won't stop anyone with a little bit of knowledge. If you can find code to hide sheets,they can find code to unhide them.

    When you have a prototype, before it contains any sensitive data, maybe you'd like to post a copy to see what we can do with it?

    All that said, it is a useful routine and it will stop a lot of people, but not all. And some will see it as a challenge.

    Regards, TMS

  6. #6
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Preventing people from opening developer mode, cut and paste or even deleting workbook

    How you going to stop print screen?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Preventing Workbook Opening
    By ScabbyDog in forum Excel General
    Replies: 3
    Last Post: 08-23-2013, 04:42 AM
  2. Can't get out of Developer Mode on Excel 2010
    By leslie0124 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-08-2013, 09:29 PM
  3. Design mode in Developer Tab
    By amanvig1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-24-2012, 08:12 AM
  4. Macro to open developer mode in IE
    By plasma33 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-16-2012, 05:05 PM
  5. Stuck in developer mode
    By JChandler22 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-06-2009, 11:07 AM

Tags for this Thread

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