A solution regarding "non-authorized" users

M

Marc R. Bertrand

Hello,

I have been posting the following below in a few windows related
newsgroups, hoping to get a professional answer once and for all.

==========================================================================
Hi,

I often create Excel files with lots of VBA code in them. I sometimes
protect the code, by giving a password to the project in the project
window (by right-clicking the project, selecting VBAProject
Properties..., protection tab, etc.)

As you know, it's possible to find web sites on the Internet that
offer password cracking software.

So, what's the point of having a password on a relatively important
file if that file's code project can be cracked open?

Since I haven't heard yet of an uncrackable password in a VBA project
(be it Excel or Word or whatever), I don't think such a thing exists.
I demand proof if it does.

Therefore, I think the best way to avoid having code messed with or
stolen is to simply delete it when an unauthorized someone wants to
get a hold of it. For the deletion to occur, a macro in the project
needs to be called or triggered and run at a precise time. That time
would be when the project expands (as when clicking on the '+' sign)
without having been opened by normal means. Assuming an unauthorized
someone cracks open the project with the help of some software, a very
special *windows* sort of event would call (API or something) the
macro which would then delete all the code in all the project modules.

Can a windows programmer help me with this or does the situation I
described above belong to some other newsgroup realm?

Thanks a lot for your attention.

Marc R. Bertrand
www.goalseek.net
(e-mail address removed)
 
T

Tom Ogilvy

If you need that type of protection, you need to write your code and compile
it as a DLL.

Any code based solution (based on code written in VBA in Excel) is easily
defeated just be disabling macros.

There are no events beyond commandbar events in the VBE. Code can't be
written to "defend itself".

Jim Rech recently posted some sample results of looking at excel an excel
file with a hex editor, demonstrating that at least the jist of the code was
readable that way. He didn't say what type of protection had been imposed
on the file from Excel - so can't say the exact situation but the message
was clear that code written in Excel itself is vulnerable.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top