[KLUG Members] MS Office VBA: A Tip For the Forgetful Programmer

Andrew Thompson apthmpsn at imagerie.com
Sat Apr 21 14:28:30 EDT 2007


I've been writing little Visual Basic applications in Microsoft Excel
and Access for a few years now. In that time, I'd come up with a handful
of routines useful enough to put in a couple of "add-on" libraries for
use in other applications. To discourage tampering and alteration, I set
a password to block casual access to the VBA code. Not intended as a
strict security measure, I made it a fairly simple one, easy to remember
if needed, or so I thought.

This last week, someone ran into a problem with an Excel workbook that
required me to step through the code. When it led to a routine in one of
my libraries, I tried to unlock it, only to find myself blocked when
none of the passwords I THOUGHT I might have used proved to be the
correct one. Oops.

Turning to Google, I found this is enough of a problem that at least
three or four packages or services out there offer to recover or bypass
Office VBA passwords, for a price. I'd finally broken down and
downloaded a trial copy of one before I thought to see what OpenOffice
might do with my file. It was a pleasant surprise to discover that OO
Calc happily opened up the code modules Excel wouldn't let me see for
love nor money! Yes! Salvation!

I can't say this would work on EVERY Office file, and I'm not even going
to begin to discuss the wisdom or morals of this little tale, but if you
should ever need to recover password-protected VBA code from an MS
Office document, OpenOffice might just be your ticket!

-- 
Andrew Thompson <apthmpsn at imagerie.com>
The Imagerie (www.imagerie.com)



More information about the Members mailing list