+ Reply to Thread
Results 1 to 8 of 8

Locking the VBA code so people cannot access it?

  1. #1
    Registered User
    Join Date
    09-04-2014
    Location
    Thailand
    MS-Off Ver
    2013
    Posts
    16

    Locking the VBA code so people cannot access it?

    I want to send a file to someone and I don't want them to have access to certain areas of the doccument and macros etc. I've found a way of forcing the doccument to open with macros enabled, blocking the sheets, by placing a VBA code upon opening the workbook...

    I've made the sheet read only with a password, and I've also put a macro in there forcing the workbook to close if they try and save/save as their own version to edit...

    I know you can put a password on the VBA screen to lock it... BUT i also know if you open another excel file, you can run a macro on that workbook that will crack the passcode to the VBA screen of the excel that you don't want them to access!

    Is there a way round this so they CAN'T access it at all????

    If they can crack the password to the VBA screen, they can just delete the macros that force close the doccument and have access to everything!

    Help!

  2. #2
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Locking the VBA code so people cannot access it?

    So what exactly are you trying to protect?
    If you want to lock down the VBA module itself you can do that.
    If you are trying to lock down a worksheet I dont think you can. As you know you can unlock sheets with brute force, so my question would then be, why include work in the sheet that you dont want to be shared?

    I would break everything and send them ONLY what you want them to have.
    Please ensure you mark your thread as Solved once it is. Click here to see how.
    If a post helps, please don't forget to add to our reputation by clicking the star icon in the bottom left-hand corner of a post.

  3. #3
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Locking the VBA code so people cannot access it?


    Hi,

    instead of a protected workbook, export data to a pdf file and send it !

  4. #4
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Locking the VBA code so people cannot access it?

    Quote Originally Posted by Marc L View Post

    Hi,

    instead of a protected workbook, export data to a pdf file and send it !

    Yeah that is always ideal.

  5. #5
    Registered User
    Join Date
    09-04-2014
    Location
    Thailand
    MS-Off Ver
    2013
    Posts
    16

    Thumbs up Re: Locking the VBA code so people cannot access it?

    Hi guys,

    Thanks for the responses!

    I either want to achieve one of two things... (Either let them view and play around with it online (an interactive xlsm file exported as a html)- seems impossible! Or send a trial file for them to have a play around with but they can't save or copy it. (To ensure they purchase the full version).

    For the second option...

    I can't really export it to a PDF file as they would then not be able to play around with it and could they not just convert it back to an Xlsm file with file conversion software?

    I want the file to be fully operational for them to use and play with, so they can get a feel for the system and decide to buy it but not keep it/crack it and use it anyway!...

    -I've put a macro in there making sure the file can't be saved (force closes if they try to)
    -There is a password on to keep it a read only file
    -I've put a killme macro in it so it will delete itself after a week (prevents them from keeping it)
    -There is a macro in there forcing them to enable macros otherwise the workbook will keep the remaining sheets veryhidden
    -I've put a password on the VBA module so they can't copy the Macros... (I know this can be cracked)
    -I've password protected the parts of the sheets I don't want them to access
    -I've hidden all the formulas
    -I've put a macro in there to delete the file attachment in the email once opened...

    BUT i know all of this can easily be undone by using another workbook VBA module to crack the password to this workbooks VBA module, then all they would just need to do is delete the macros that prevent the book from being saved/closed/deleted etc, and they would have full access to all of the file.

    Is there a way of them NOT being able to access the VBA module at all and completely block it?? If they can gain access to the VBA then they can gain access to all of it, and then they won't buy it!

    The file is also over 5MB so i can't really share it and make it a 'prevent download file' online, Skydrive forces them open it in excel. I'm a little stuck!

    Cheers for the help so far.

    Thomas
    Last edited by ThomasAnthony; 09-13-2014 at 03:31 AM.

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

    Re: Locking the VBA code so people cannot access it?

    you can't fully protect an excel workbook. you'll have to use a spreadsheet compiler like lockxls or a compiled language to write your code
    Josie

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

  7. #7
    Registered User
    Join Date
    09-04-2014
    Location
    Thailand
    MS-Off Ver
    2013
    Posts
    16

    Re: Locking the VBA code so people cannot access it?

    Hi,

    Have you ever used Lockxls before? And if so, is worth (i'm assuming) the price tag!?

    Cheers

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

    Re: Locking the VBA code so people cannot access it?

    no-I've never had any need for it

+ 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. VBA code to send email to the people whose email address is in the Access table
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-30-2014, 05:11 AM
  2. Replies: 4
    Last Post: 03-13-2014, 11:22 AM
  3. Access Forms for people who have Access
    By jghender in forum Access Tables & Databases
    Replies: 1
    Last Post: 06-26-2013, 08:50 PM
  4. Locking a workbook with limited user access
    By keb75 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-27-2011, 12:50 AM
  5. Access - Creating report requiring password/username for multiple people
    By shadestreet in forum Access Tables & Databases
    Replies: 2
    Last Post: 04-25-2009, 04:56 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