Excel工作表保护密码破解方法:óúCÄx±+^Îbbs.3c3t.com80#)B½
1\打开文件óúCÄx±+^Îbbs.3c3t.com80#)B½
2\工具---宏----录制新宏---输入名字如:aaóúCÄx±+^Îbbs.3c3t.com80#)B½
3\停止录制(这样得到一个空宏)óúCÄx±+^Îbbs.3c3t.com80#)B½
4\工具---宏----宏,选aa,点编辑按钮óúCÄx±+^Îbbs.3c3t.com80#)B½
5\删除窗口中的所有字符(只有几个),替换为下面的内容:(复制吧)óúCÄx±+^Îbbs.3c3t.com80#)B½
6\关闭编辑窗口óúCÄx±+^Îbbs.3c3t.com80#)B½
7\工具---宏-----宏,选AllInternalPasswords,运行,确定两次,等2分钟,再确定.OK,没有密码了!!内容如下:Public Sub AllInternalPasswords() óúCÄx±+^Îbbs.3c3t.com80#)B½
' Breaks worksheet and workbook structure passwords. Bob McCormick óúCÄx±+^Îbbs.3c3t.com80#)B½
' probably originator of base code algorithm modified for coverage óúCÄx±+^Îbbs.3c3t.com80#)B½
' of workbook structure / windows passwords and for multiple passwords óúCÄx±+^Îbbs.3c3t.com80#)B½
' óúCÄx±+^Îbbs.3c3t.com80#)B½
' Norman Harker and JE McGimpsey 27-Dec-2002 (Version 1.1) óúCÄx±+^Îbbs.3c3t.com80#)B½
' Modified 2003-Apr-04 by JEM: All msgs to constants, and óúCÄx±+^Îbbs.3c3t.com80#)B½
' eliminate one Exit Sub (Version 1.1.1) óúCÄx±+^Îbbs.3c3t.com80#)B½
' Reveals hashed passwords NOT original passwords óúCÄx±+^Îbbs.3c3t.com80#)B½
Const DBLSPACE As String = vbNewLine & vbNewLine óúCÄx±+^Îbbs.3c3t.com80#)B½
Const AUTHORS As String = DBLSPACE & vbNewLine & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
"Adapted from Bob McCormick base code by" & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
"Norman Harker and JE McGimpsey" óúCÄx±+^Îbbs.3c3t.com80#)B½
Const HEADER As String = "AllInternalPasswords User Message" óúCÄx±+^Îbbs.3c3t.com80#)B½
Const VERSION As String = DBLSPACE & "Version 1.1.1 2003-Apr-04" óúCÄx±+^Îbbs.3c3t.com80#)B½
Const REPBACK As String = DBLSPACE & "Please report failure " & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
"to the microsoft.public.excel.programming newsgroup." óúCÄx±+^Îbbs.3c3t.com80#)B½
Const ALLCLEAR As String = DBLSPACE & "The workbook should " & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
"now be free of all password protection, so make sure you:" & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
DBLSPACE & "SAVE IT NOW!" & DBLSPACE & "and also" & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
DBLSPACE & "BACKUP!, BACKUP!!, BACKUP!!!" & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
DBLSPACE & "Also, remember that the password was " & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
"put there for a reason. Don't stuff up crucial formulas " & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
"or data." & DBLSPACE & "Access and use of some data " & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
"may be an offense. If in doubt, don't." óúCÄx±+^Îbbs.3c3t.com80#)B½
Const MSGNOPWORDS1 As String = "There were no passwords on " & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
"sheets, or workbook structure or windows." & AUTHORS & VERSION óúCÄx±+^Îbbs.3c3t.com80#)B½
Const MSGNOPWORDS2 As String = "There was no protection to " & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
"workbook structure or windows." & DBLSPACE & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
"Proceeding to unprotect sheets." & AUTHORS & VERSION óúCÄx±+^Îbbs.3c3t.com80#)B½
Const MSGTAKETIME As String = "After pressing OK button this " & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
"will take some time." & DBLSPACE & "Amount of time " & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
"depends on how many different passwords, the " & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
"passwords, and your computer's specification." & DBLSPACE & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
"Just be patient! Make me a coffee!" & AUTHORS & VERSION óúCÄx±+^Îbbs.3c3t.com80#)B½
Const MSGPWORDFOUND1 As String = "You had a Worksheet " & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
"Structure or Windows Password set." & DBLSPACE & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
"The password found was: " & DBLSPACE & "$$" & DBLSPACE & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
"Note it down for potential future use in other workbooks by " & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
"the same person who set this password." & DBLSPACE & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
"Now to check and clear other passwords." & AUTHORS & VERSION óúCÄx±+^Îbbs.3c3t.com80#)B½
Const MSGPWORDFOUND2 As String = "You had a Worksheet " & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
"password set." & DBLSPACE & "The password found was: " & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
DBLSPACE & "$$" & DBLSPACE & "Note it down for potential " & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
"future use in other workbooks by same person who " & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
"set this password." & DBLSPACE & "Now to check and clear " & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
"other passwords." & AUTHORS & VERSION óúCÄx±+^Îbbs.3c3t.com80#)B½
Const MSGONLYONE As String = "Only structure / windows " & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
"protected with the password that was just found." & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
ALLCLEAR & AUTHORS & VERSION & REPBACK óúCÄx±+^Îbbs.3c3t.com80#)B½
Dim w1 As Worksheet, w2 As Worksheet óúCÄx±+^Îbbs.3c3t.com80#)B½
Dim i As Integer, j As Integer, k As Integer, l As Integer óúCÄx±+^Îbbs.3c3t.com80#)B½
Dim m As Integer, n As Integer, i1 As Integer, i2 As Integer óúCÄx±+^Îbbs.3c3t.com80#)B½
Dim i3 As Integer, i4 As Integer, i5 As Integer, i6 As Integer óúCÄx±+^Îbbs.3c3t.com80#)B½
Dim PWord1 As String óúCÄx±+^Îbbs.3c3t.com80#)B½
Dim ShTag As Boolean, WinTag As Boolean óúCÄx±+^Îbbs.3c3t.com80#)B½
Application.ScreenUpdating = False óúCÄx±+^Îbbs.3c3t.com80#)B½
With ActiveWorkbook óúCÄx±+^Îbbs.3c3t.com80#)B½
WinTag = .ProtectStructure Or .ProtectWindows óúCÄx±+^Îbbs.3c3t.com80#)B½
End With óúCÄx±+^Îbbs.3c3t.com80#)B½
ShTag = False óúCÄx±+^Îbbs.3c3t.com80#)B½
For Each w1 In Worksheets óúCÄx±+^Îbbs.3c3t.com80#)B½
ShTag = ShTag Or w1.ProtectContents óúCÄx±+^Îbbs.3c3t.com80#)B½
Next w1 óúCÄx±+^Îbbs.3c3t.com80#)B½
If Not ShTag And Not WinTag Then óúCÄx±+^Îbbs.3c3t.com80#)B½
MsgBox MSGNOPWORDS1, vbInformation, HEADER óúCÄx±+^Îbbs.3c3t.com80#)B½
Exit Sub óúCÄx±+^Îbbs.3c3t.com80#)B½
End If óúCÄx±+^Îbbs.3c3t.com80#)B½
MsgBox MSGTAKETIME, vbInformation, HEADER óúCÄx±+^Îbbs.3c3t.com80#)B½
If Not WinTag Then óúCÄx±+^Îbbs.3c3t.com80#)B½
MsgBox MSGNOPWORDS2, vbInformation, HEADER óúCÄx±+^Îbbs.3c3t.com80#)B½
Else óúCÄx±+^Îbbs.3c3t.com80#)B½
On Error Resume Next óúCÄx±+^Îbbs.3c3t.com80#)B½
Do 'dummy do loop óúCÄx±+^Îbbs.3c3t.com80#)B½
For i = 65 To 66: For j = 65 To 66: For k = 65 To 66 óúCÄx±+^Îbbs.3c3t.com80#)B½
For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66 óúCÄx±+^Îbbs.3c3t.com80#)B½
For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66 óúCÄx±+^Îbbs.3c3t.com80#)B½
For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126 óúCÄx±+^Îbbs.3c3t.com80#)B½
With ActiveWorkbook óúCÄx±+^Îbbs.3c3t.com80#)B½
.Unprotect Chr(i) & Chr(j) & Chr(k) & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n) óúCÄx±+^Îbbs.3c3t.com80#)B½
If .ProtectStructure = False And _ óúCÄx±+^Îbbs.3c3t.com80#)B½
.ProtectWindows = False Then óúCÄx±+^Îbbs.3c3t.com80#)B½
PWord1 = Chr(i) & Chr(j) & Chr(k) & Chr(l) & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
Chr(i4) & Chr(i5) & Chr(i6) & Chr(n) óúCÄx±+^Îbbs.3c3t.com80#)B½
MsgBox Application.Substitute(MSGPWORDFOUND1, _ óúCÄx±+^Îbbs.3c3t.com80#)B½
"$$", PWord1), vbInformation, HEADER óúCÄx±+^Îbbs.3c3t.com80#)B½
Exit Do 'Bypass all for...nexts óúCÄx±+^Îbbs.3c3t.com80#)B½
End If óúCÄx±+^Îbbs.3c3t.com80#)B½
End With óúCÄx±+^Îbbs.3c3t.com80#)B½
Next: Next: Next: Next: Next: Next óúCÄx±+^Îbbs.3c3t.com80#)B½
Next: Next: Next: Next: Next: Next óúCÄx±+^Îbbs.3c3t.com80#)B½
Loop Until True óúCÄx±+^Îbbs.3c3t.com80#)B½
On Error GoTo 0 óúCÄx±+^Îbbs.3c3t.com80#)B½
End If óúCÄx±+^Îbbs.3c3t.com80#)B½
If WinTag And Not ShTag Then óúCÄx±+^Îbbs.3c3t.com80#)B½
MsgBox MSGONLYONE, vbInformation, HEADER óúCÄx±+^Îbbs.3c3t.com80#)B½
Exit Sub óúCÄx±+^Îbbs.3c3t.com80#)B½
End If óúCÄx±+^Îbbs.3c3t.com80#)B½
On Error Resume Next óúCÄx±+^Îbbs.3c3t.com80#)B½
For Each w1 In Worksheets óúCÄx±+^Îbbs.3c3t.com80#)B½
'Attempt clearance with PWord1 óúCÄx±+^Îbbs.3c3t.com80#)B½
w1.Unprotect PWord1 óúCÄx±+^Îbbs.3c3t.com80#)B½
Next w1 óúCÄx±+^Îbbs.3c3t.com80#)B½
On Error GoTo 0 óúCÄx±+^Îbbs.3c3t.com80#)B½
ShTag = False óúCÄx±+^Îbbs.3c3t.com80#)B½
For Each w1 In Worksheets óúCÄx±+^Îbbs.3c3t.com80#)B½
'Checks for all clear ShTag triggered to 1 if not. óúCÄx±+^Îbbs.3c3t.com80#)B½
ShTag = ShTag Or w1.ProtectContents óúCÄx±+^Îbbs.3c3t.com80#)B½
Next w1 óúCÄx±+^Îbbs.3c3t.com80#)B½
If ShTag Then óúCÄx±+^Îbbs.3c3t.com80#)B½
For Each w1 In Worksheets óúCÄx±+^Îbbs.3c3t.com80#)B½
With w1 óúCÄx±+^Îbbs.3c3t.com80#)B½
If .ProtectContents Then óúCÄx±+^Îbbs.3c3t.com80#)B½
On Error Resume Next óúCÄx±+^Îbbs.3c3t.com80#)B½
Do 'Dummy do loop óúCÄx±+^Îbbs.3c3t.com80#)B½
For i = 65 To 66: For j = 65 To 66: For k = 65 To 66 óúCÄx±+^Îbbs.3c3t.com80#)B½
For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66 óúCÄx±+^Îbbs.3c3t.com80#)B½
For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66 óúCÄx±+^Îbbs.3c3t.com80#)B½
For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126 óúCÄx±+^Îbbs.3c3t.com80#)B½
.Unprotect Chr(i) & Chr(j) & Chr(k) & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
Chr(i4) & Chr(i5) & Chr(i6) & Chr(n) óúCÄx±+^Îbbs.3c3t.com80#)B½
If Not .ProtectContents Then óúCÄx±+^Îbbs.3c3t.com80#)B½
PWord1 = Chr(i) & Chr(j) & Chr(k) & Chr(l) & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _ óúCÄx±+^Îbbs.3c3t.com80#)B½
Chr(i4) & Chr(i5) & Chr(i6) & Chr(n) óúCÄx±+^Îbbs.3c3t.com80#)B½
MsgBox Application.Substitute(MSGPWORDFOUND2, _ óúCÄx±+^Îbbs.3c3t.com80#)B½
"$$", PWord1), vbInformation, HEADER óúCÄx±+^Îbbs.3c3t.com80#)B½
'leverage finding Pword by trying on other sheets óúCÄx±+^Îbbs.3c3t.com80#)B½
For Each w2 In Worksheets óúCÄx±+^Îbbs.3c3t.com80#)B½
w2.Unprotect PWord1 óúCÄx±+^Îbbs.3c3t.com80#)B½
Next w2 óúCÄx±+^Îbbs.3c3t.com80#)B½
Exit Do 'Bypass all for...nexts óúCÄx±+^Îbbs.3c3t.com80#)B½
End If óúCÄx±+^Îbbs.3c3t.com80#)B½
Next: Next: Next: Next: Next: Next óúCÄx±+^Îbbs.3c3t.com80#)B½
Next: Next: Next: Next: Next: Next óúCÄx±+^Îbbs.3c3t.com80#)B½
Loop Until True óúCÄx±+^Îbbs.3c3t.com80#)B½
On Error GoTo 0 óúCÄx±+^Îbbs.3c3t.com80#)B½
End If óúCÄx±+^Îbbs.3c3t.com80#)B½
End With óúCÄx±+^Îbbs.3c3t.com80#)B½
Next w1 óúCÄx±+^Îbbs.3c3t.com80#)B½
End If óúCÄx±+^Îbbs.3c3t.com80#)B½
MsgBox ALLCLEAR & AUTHORS & VERSION & REPBACK, vbInformation, HEADER óúCÄx±+^Îbbs.3c3t.com80#)B½
End SubóúCÄx±+^Îbbs.3c3t.com80#)B½