PDA

View Full Version : Self Destruct VBA Code



melsahn
06-05-2009, 08:27 AM
Hey whats up guys? I needed some help with getting a self destruct code to destruct the excel file if the password for getting into the visual basic editor is wrong or right. Im sure its possible because I know theres a code to self destruct if the password is wrong. Please if anyone can help Id really appreciate it! Thanks!

melsahn
06-05-2009, 08:28 AM
Refer to http://www.vbaexpress.com/kb/getarticle.php?kb_id=475 if this helps.

ChloeRadshaw
06-05-2009, 03:10 PM
Awesome - Now we will get contractors self destructing their workbooks if they are no longer at the company

Nice.

I mean that light heartedly by the way

I would strongly discourage this to be used.

Anyone can disable macros when the workbook is started up

melsahn
06-05-2009, 04:05 PM
that was a nice one lol but i spent years and years developing this program though Im not too familiar with Visual Basic, I believe I deserve to keep my hard work from falling in the wrong hands :-)

Simon Lloyd
06-05-2009, 05:22 PM
that was a nice one lol but i spent years and years developing this program though Im not too familiar with Visual Basic, I believe I deserve to keep my hard work from falling in the wrong hands :-)Then you should look at making your file a .exe or perhaps using LockXls http://www.lockxls.com/

Emily
06-05-2009, 11:00 PM
Caution, backup before you test your Workbook


Application.DisplayAlerts = False
ActiveWorkbook.ChangeFileAccess xlReadOnly
Kill ActiveWorkbook.FullName
ThisWorkbook.Close False

Oorang
06-06-2009, 02:37 AM
I can't vouch for the product, but I agree with Simon that if you want to protect your workbook, you may want something a little more serious than VBA. VBA protection schemes are notoriously vulnerable to the "notepad" attack. Moreover, the most awesome VBA ever is still easily foiled by disabling macros :s

Of course, all protection can be reversed with enough time, effort, and skill. You don't really need perfect protection, you just need to escalate the cost of the attack past the benefit of the succeeding.

GTO
06-06-2009, 04:47 AM
...You don't really need perfect protection, you just need to escalate the cost of the attack past the benefit of the succeeding.

Hi Aaron and Bravo! I do not think it could be put more succinctly; the essence of all sensible warfare and/or thievery. To be dedicated beyond what is sensible requires dedication absent among thieves.

Mark

melsahn
06-06-2009, 09:32 AM
Of course, all protection can be reversed with enough time, effort, and skill. You don't really need perfect protection, you just need to escalate the cost of the attack past the benefit of the succeeding.


Hi Aaron and Bravo! I do not think it could be put more succinctly; the essence of all sensible warfare and/or thievery. To be dedicated beyond what is sensible requires dedication absent among thieves.

Mark


Both of you's have made quite a clever point i should say :yes , Im going to take a look into that maybe Itll work out Thanks alot guys I appreciate it!

melsahn
06-06-2009, 09:34 AM
VBA:
Application.DisplayAlerts = False ActiveWorkbook.ChangeFileAccess xlReadOnly Kill ActiveWorkbook.FullName ThisWorkbook.Close False



Then you should look at making your file a .exe or perhaps using LockXls http://www.lockxls.com/

Thanks alot Simon and Emily I appreciate your time for answering!:beerchug:

Oorang
06-07-2009, 12:52 AM
lol well it's hardly original, Bruce Schneier wrote a whole book about it:)