监理检测网论坛

注册

 

发新话题 回复该主题

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

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

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

,ÃÐë»jC”.bbs.3c3t.com³Çœ{{¦_Ñ
我在黄河上
TOP
3#

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

???,ÃÐë»jC”.bbs.3c3t.com³Çœ{{¦_Ñ
TOP
4#

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

,ÃÐë»jC”.bbs.3c3t.com³Çœ{{¦_Ñ
TOP
5#

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

谢谢了,ÃÐë»jC”.bbs.3c3t.com³Çœ{{¦_Ñ
TOP
发主话题 回复该主题