监理检测网论坛

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