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