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