开发者

Excel-VBA: Modify Application Without Using Password. [duplicate]

This question already has answers here: Is there a way to crack the password on an Excel VBA Project? 开发者_运维知识库 (25 answers) Closed 8 years ago.

I have developed an application using Excel-VBA and applied password protection to it to prevent modification. Now, I have forgotten the password and I want to update my application. Is there any way to modify the application without using the password?


My interpretation of this discussion is that it is OK to provide a link to password cracking software for worksheet passwords, but not for passwords protecting VBA code.

To unprotect worksheets, I like the code posted by Microsoft Excel MVP Nico Sterk at http://members.chello.nl/n.sterk/ExcelPages/Files/excel_files.htm The BreakPassword macro in the downloaded workbook will identify a substitute password in about a minute. It requires Excel 2000 and later. Here is how to use it: 1) Click on any cell in the worksheet that you want to unprotect 2) ALT + F8 to open the macro selector 3) Choose the PasswordBreaker macro (from Nico Sterk's workbook), then click the "Run" button

With Excel 97 and 2000, there is an amazing loophole discovered by MalicUK--just reset the password to an empty string using VBA:

Sub UnprotectActiveSheet() 
 Dim ws As Worksheet 
 Set ws = ActiveSheet 
 ws.Protect "", , , , True 
 ws.Range("A1").Copy 
 ws.Range("A1") End 
Sub

-Anonymous

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜