Closed Thread
Results 1 to 8 of 8

Excel 2010 VBA password protection / encryption?

  1. #1
    Registered User
    Join Date
    01-04-2011
    Location
    Texas, USA
    MS-Off Ver
    Excel 2007 / Excel 2011
    Posts
    3

    Question Excel 2010 VBA password protection / encryption?

    Hello,

    I am curious about the strength of the Excel 2010 VBA password protection and if there are any ways to improve it.

    I've read that the workbook encryption for Excel 2007 and above are strong if you change the default settings and use a very strong password, but that doesn't do me any good because my end user needs to have access to the workbook, so he will have the main encryption password anyways.

    I want to be able to lock down the VBA portion of the workbook, and I've read that MS hasn't improved on that password protection any (it's still easily cracked).

    I saw one website had an offering (paid) to "scramble" the VBA so that even if the password is cracked, the underlying code is unreadable.

    This sounds fishy to me. Is it really possible to do that?

    Anyways, my end result is to have a spreadsheet application in which the VBA makes it a "timed trial version" that, upon expiration, some of the non-essential functionality is disabled. This is useless if the VBA can be accessed and then the "trial version" code altered or removed.

    Is it possible to TRULY protect the VBA code?

    Thanks in advance,

    Jason

  2. #2
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Excel 2010 VBA password protection / encryption?

    I'm just going to throw my own limited 2 pennies in on this and say that if someone really wants to get into your code bad enough, they'll find way. Look at MS operating systems as an example, there are always pirated versions out there which means that a fully protected anything is not really possible. For your module code, make ridiculously long passwords with both letters and numbers and store them someplace safe where you won't forget them. As for removing procedures with VBA, try what this link has to offer to see if it meets your requirements. If you could apply something like that to the Workbook_Open event to activate a select number of days from the initial open (I don't know if that is possible), you may be on track.

    Good Luck
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

  3. #3
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Excel 2010 VBA password protection / encryption?

    There are apps that will obfuscate your code by using gibberish names for variables and routines etc. which will certainly slow someone down. VBA itself will never be terribly secure (length/complexity of password being irrelevant); if you really need security for your code, you need to compile it into an executable and then call that from VBA.
    Remember what the dormouse said
    Feed your head

  4. #4
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: Excel 2010 VBA password protection / encryption?

    Am not too sure, but I've dealt with a VBA macro before that can't be opened. I.e. you can't expand the VBA project for that particular spreadsheet and it says something like "Project is unviewable." on a workbook that is NOT shared. Anyone else seen something like this?

    With regards to VBA protection, to the average user, the protection there is sufficient. Give this to someone with determination to look at your code, it is definitely doable, regardless of how long your password is. With some know-how, it can be done in seconds. And as Mordred put it, there's no perfect protection out there, you just have to identify the risk, and choose whether or not to accept it.

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Excel 2010 VBA password protection / encryption?

    I've seen what you mean, but posting how to would then allow others to reverse it!
    Hope that helps.

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

    Free DataBaseForm example

  6. #6
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: Excel 2010 VBA password protection / encryption?

    Good point Roy. I see the paradox. Though I am very curious to know more about it.

  7. #7
    Registered User
    Join Date
    10-30-2011
    Location
    Penang, Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Excel 2010 VBA password protection / encryption?

    I have been trying to lock my code (right-clicking on VBA Project Name from explorer bar on left of VBA Editor > Going to Project Properties > Going to Protection tab > Checking 'Lock Project for viewing' > Entering Password (twice) > Saving project > Saving Excel file > Closing and reopening). When I do this it does not protect VBA project. I can open it and view/edit it with no problem. When I go back to Project Properties, my 'Lock Project for Viewing' is no longer checked and the password boxes are empty. Advise Needed, Thank you.

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Excel 2010 VBA password protection / encryption?

    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.

Closed Thread

Thread Information

Users Browsing this Thread

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

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