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