Poll

Aboot this blog

This blog is a cross between a scrapbook and a diary. I hope you find something here of interest. If you’d like to keep up with things as I see them then you can subscribe to my news feed by clicking the icon below:

feed-icon-28x28.png

DISCLAIMER

Please note that any reviews/recommendations are based solely on my own experience and does not constitute a guarantee that you will have the same experience. Please do your own research before parting with any money - the risk is all yours!

The Briticiser

Looking for my world famous US to GB English spelling converter?

THE “BRITICIZSER”

www.us2uk.eu

IT’S HERE

Tags

  Bits and Bobs     Windows     Equipment     PHP     Education     Word     Odds and Sods     Utilities     Family     News     Excel     VBA     Bookmarks     3D Stuff     Plausible Lies     Hardware     Tutorials     Acrobat     Reviews     Software     Browsers     Flatpress     Overcoming Disabilities      

Find me on Facebook

facebook-icon-28x28.pngVisit my Briticiser Facebook Page to keep up with things here - lots of reviews of stuff I’ve really used and also all kinds of helpful computer tips with a heavy bias towards SAVING YOU TIME.

How to crack the password on an Excel VBA Project

Permalink: http://paul.us2uk.eu/?x=entry:entry170809-124855

I never set passwords on my VBA Projects. Initially this was out of pure laziness but they’re not secure anyway so setting one is pointless if the sole reason for setting one is to keep your code a jealously guarded secret.

Now, there are legitimate reasons why you might want to crack a VBA Project password and I recently needed to do just that on one of the workbooks in our office which was causing the user a problem when trying to copy and paste from one sheet to another: when the user selected a different tab they also “lost” whatever was on their clipboard so they couldn’t do the usual thing of selecting a cell in the sheet where they wanted to paste something when the “Select destination and press ENTER or choose paste” message appeared at the bottom, because this message disappeared when they selected a new sheet.

There was obviously some script being triggered when they selected this sheet and, if you carry out any operation on a sheet before you get chance to paste your information in, then that chance goes begging.

Unfortunately this particular workbook was one they’d inherited from a user who had long-since left the company and the VBA Project had been locked with a password to protect the code… but no-one knew the password.

Of course there are solutions out there which you can download or buy but, if you’re already comfortable with VBA (otherwise why would you want to get in there to fix things?) then here’s an easy solution which works for all versions of Excel, both 32 bit and 64 bit.

https://stackoverflow.com/a/27508116

Make sure you click the link (or scroll down the page) to see the corresponding code for 64 bit versions of Excel (you need to use the code which applies to your version).

Credit for this solution goes to Duc Thanh Nguyen.

The basic instructions are that you copy the code given into a new workbook, save that with whatever file name you want, then leave the workbook open.

Switch back to your workbook with VBA password protection enabled and click on the Developer tab, then Macros, and choose to run the macro called, simply, “unprotected” which should pop up a nice friendly message like this:

VBA Project is unprotected message box

Support our caregiving

If you found anything on this site of use, interesting, or even mildly amusing then please consider dropping a few pennies in the jar to help us to take care of our disabled son who contracted encephalitis in 2007 at the age of 6 and who is now confined to a wheelchair. He is getting bigger as his mother and I get older, imagine that, please. Every penny we collect goes towards his upkeep, and towards his future care requirements.

Thank you.

Support our caregiving

Support our caregiving

If you found anything on this site of use, interesting, or even mildly amusing then please consider dropping a few pennies in the jar to help us to take care of our disabled son who contracted encephalitis in 2007 at the age of 6 and who is now confined to a wheelchair. He is getting bigger as his mother and I get older, imagine that, please. Every penny we collect goes towards his upkeep, and towards his future care requirements.

Thank you.