监理检测网论坛

注册

 

发新话题 回复该主题

删除EXCEL工作表保护密码 [复制链接]

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

回复:删除EXCEL工作表保护密码

på9µ…Cº ¼bbs.3c3t.comÀñ¯«#ió.š¹
我在黄河上
TOP
3#

回复:删除EXCEL工作表保护密码

???på9µ…Cº ¼bbs.3c3t.comÀñ¯«#ió.š¹
TOP
4#

回复:删除EXCEL工作表保护密码

på9µ…Cº ¼bbs.3c3t.comÀñ¯«#ió.š¹
TOP
5#

回复:删除EXCEL工作表保护密码

谢谢了på9µ…Cº ¼bbs.3c3t.comÀñ¯«#ió.š¹
TOP
发主话题 回复该主题