如何解除各版本excel工作表与工作薄保护密码

来源:趣味经验馆 2.59W

撤销是不能撤销的,只能通过破copy解密码来实现,可以用修改后缀名称的方法。工具:华硕电脑1、首先找到Excel表格,修改后缀名称xlsx改为演示操作表格rar,如下图所示2、然后用压缩文件打开,然后打开xl,如下图所示3、然后把压缩文件里面找到的sheet1.xml文件,然后拖拽出来,然后要进行修改,如下图所示4、然后sheet1.xml文件打开用记事本打开,然后搜索protection,把图中的这zd一段代码,全部删除掉,如下图所示。5、再把修改后的sheet1.xml文件,选择拖拽到压缩的工作蒲中,选择替换掉就可以,如下图所示。6、把文件名称.rar重新更改.xlsx,然后再打开工作表保护就撤销了,如下图所示。本回答被网友采纳,原发布者:飞莲无解666如何破解EXCEL工作表保护密码忘记密码怎么办1.新建一个EXCEL工作表,而后点击另存为,讲表格保存为启用宏的工作表2.一次点击开发工具---录制新宏,在弹出的对话框内修改宏名称而后确定3.依次点击开发工具----停止录制宏,宏录制完成4.依次点击开发工具,---宏----在弹出的对话框找到我们刚才录制的宏名称而后进入VBA界面5.在VBA界面,全选里面的代码,而后删除,讲里面的代码全部删除完7a64e58685e5aeb9313334336237636.代码复制到VBA编辑窗口内PublicSubAllInternalPasswords() 'Breaksworksheetandworkbookstructurepasswords.BobMcCormick 'probablyoriginatorofbasecodealgorithmmodifiedforcoverage 'ofworkbookstructure/windowspasswordsandformultiplepasswords ' 'NormanHarkerandJEMcGimpsey27-Dec-2002(Version1.1) 'Modified2003-Apr-04byJEM:Allmsgstoconstants,and 'eliminateoneExitSub(Version1.1.1) 'RevealshashedpasswordsNOToriginalpasswords ConstDBLSPACEAsString=vbNewLine&vbNewLine ConstAUTHORSAsString=DBLSPACE&vbNewLine&_ "AdaptedfromBobMcCormickbasecodeby"&_ "NormanHarkerandJEMcGimpsey" ConstHEADERAsString="AllInternalPasswordsUserMessage" ConstVERSIONAsString=DBLSPACE&"Version1.1.12003-Apr-04" ConstREPBACKAsString=DBLS,按下面步骤操作,如果不会发邮件给我吧 [email protected]\打开文件 2\工具e79fa5e98193e59b9ee7ad9431333262383635---宏----录制新宏---输入名字如:aa 3\停止录制(这样得到一个空宏) 4\工具---宏----宏,选aa,点编辑按钮 5\删除窗口中的所有字符(只有几个),替换为下面的内容:(你复制吧) Option ExplicitPublic Sub AllInternalPasswords() ' Breaks worksheet and workbook structure passwords. Bob McCormick ' probably originator of base code algorithm modified for coverage ' of workbook structure / windows passwords and for multiple passwords ' ' Norman Harker and JE McGimpsey 27-Dec-2002 (Version 1.1) ' Modified 2003-Apr-04 by JEM: All msgs to constants, and ' eliminate one Exit Sub (Version 1.1.1) ' Reveals hashed passwords NOT original passwords Const DBLSPACE As String = vbNewLine & vbNewLine Const AUTHORS As String = DBLSPACE & vbNewLine & _ "Adapted from Bob McCormick base code by" & _ "Norman Harker and JE McGimpsey" Const HEADER As String = "AllInternalPasswords User Message" Const VERSION As String = DBLSPACE & "Version 1.1.1 2003-Apr-04" Const REPBACK As String = DBLSPACE & "Please report failure " & _ "to the microsoft.public.excel.programming newsgroup." Const ALLCLEAR As String = DBLSPACE & "The workbook should " & _ "now be free of all password protection, so make sure you:" & _ DBLSPACE & "SAVE IT NOW!" & DBLSPACE & "and also" & _ DBLSPACE & "BACKUP!, BACKUP!!, BACKUP!!!" & _ DBLSPACE & "Also, remember that the password was " & _ "put there for a reason. Don't stuff up crucial formulas " & _ "or data." & DBLSPACE & "Access and use of some data " & _ "may be an offense. If in doubt, don't." Const MSGNOPWORDS1 As String = "There were no passwords on " & _ "sheets, or workbook structure or windows." & AUTHORS & VERSION Const MSGNOPWORDS2 As String = "There was no protection to " & _ "workbook structure or windows." & DBLSPACE & _ "Proceeding to unprotect sheets." & AUTHORS & VERSION Const MSGTAKETIME As String = "After pressing OK button this " & _ "will take some time." & DBLSPACE & "Amount of time " & _ "depends on how many different passwords, the " & _ "passwords, and your computer's specification." & DBLSPACE & _ "Just be patient! Make me a coffee!" & AUTHORS & VERSION Const MSGPWORDFOUND1 As String = "You had a Worksheet " & _ "Structure or Windows Password set." & DBLSPACE & _ "The password found was: " & DBLSPACE & "$$" & DBLSPACE & _ "Note it down for potential future use in other workbooks by " & _ "the same person who set this password." & DBLSPACE & _ "Now to check and clear other passwords." & AUTHORS & VERSION Const MSGPWORDFOUND2 As String = "You had a Worksheet " & _ "password set." & DBLSPACE & "The password found was: " & _ DBLSPACE & "$$" & DBLSPACE & "Note it down for potential " & _ "future use in other workbooks by same person who " & _ "set this password." & DBLSPACE & "Now to check and clear " & _ "other passwords." & AUTHORS & VERSION Const MSGONLYONE As String = "Only structure / windows " & _ "protected with the password that was just found." & _ ALLCLEAR & AUTHORS & VERSION & REPBACK Dim w1 As Worksheet, w2 As Worksheet Dim i As Integer, j As Integer, k As Integer, l As Integer Dim m As Integer, n As Integer, i1 As Integer, i2 As Integer Dim i3 As Integer, i4 As Integer, i5 As Integer, i6 As Integer Dim PWord1 As String Dim ShTag As Boolean, WinTag As BooleanApplication.ScreenUpdating = False With ActiveWorkbook WinTag = .ProtectStructure Or .ProtectWindows End With ShTag = False For Each w1 In Worksheets ShTag = ShTag Or w1.ProtectContents Next w1 If Not ShTag And Not WinTag Then MsgBox MSGNOPWORDS1, vbInformation, HEADER Exit Sub End If MsgBox MSGTAKETIME, vbInformation, HEADER If Not WinTag Then MsgBox MSGNOPWORDS2, vbInformation, HEADER Else On Error Resume Next Do 'dummy do loop For i = 65 To 66: For j = 65 To 66: For k = 65 To 66 For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66 For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66 For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126 With ActiveWorkbook .Unprotect Chr(i) & Chr(j) & Chr(k) & _ Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & _ Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n) If .ProtectStructure = False And _ .ProtectWindows = False Then PWord1 = Chr(i) & Chr(j) & Chr(k) & Chr(l) & _ Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _ Chr(i4) & Chr(i5) & Chr(i6) & Chr(n) MsgBox Application.Substitute(MSGPWORDFOUND1, _ "$$", PWord1), vbInformation, HEADER Exit Do 'Bypass all for...nexts End If End With Next: Next: Next: Next: Next: Next Next: Next: Next: Next: Next: Next Loop Until True On Error GoTo 0 End If If WinTag And Not ShTag Then MsgBox MSGONLYONE, vbInformation, HEADER Exit Sub End If On Error Resume Next For Each w1 In Worksheets 'Attempt clearance with PWord1 w1.Unprotect PWord1 Next w1 On Error GoTo 0 ShTag = False For Each w1 In Worksheets 'Checks for all clear ShTag triggered to 1 if not. ShTag = ShTag Or w1.ProtectContents Next w1 If ShTag Then For Each w1 In Worksheets With w1 If .ProtectContents Then On Error Resume Next Do 'Dummy do loop For i = 65 To 66: For j = 65 To 66: For k = 65 To 66 For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66 For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66 For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126 .Unprotect Chr(i) & Chr(j) & Chr(k) & _ Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _ Chr(i4) & Chr(i5) & Chr(i6) & Chr(n) If Not .ProtectContents Then PWord1 = Chr(i) & Chr(j) & Chr(k) & Chr(l) & _ Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _ Chr(i4) & Chr(i5) & Chr(i6) & Chr(n) MsgBox Application.Substitute(MSGPWORDFOUND2, _ "$$", PWord1), vbInformation, HEADER 'leverage finding Pword by trying on other sheets For Each w2 In Worksheets w2.Unprotect PWord1 Next w2 Exit Do 'Bypass all for...nexts End If Next: Next: Next: Next: Next: Next Next: Next: Next: Next: Next: Next Loop Until True On Error GoTo 0 End If End With Next w1 End If MsgBox ALLCLEAR & AUTHORS & VERSION & REPBACK, vbInformation, HEADER End Sub6\关闭编辑窗口 7\工具---宏-----宏,选AllInternalPasswords,运行,确定两次,等2分钟,再确定.OK,没有密码了!!本回答被提问者采纳www.51dongshi.com防采集。

大家在日常使用的过程中,经常会制作一些不允许别人修改的工作簿,这个时候就会使用保护密码,但有时候如果忘记了保护密码,要怎么解除工作表与工作薄的保护密码呢?一起来看看吧!

方法

打开需要破解密码的Excel。

1、在进行编辑的excel地表的情况下中,那么就出现提示了无法进行编辑excel。2、然后需要进

如何解除各版本excel工作表与工作薄保护密码

按Alt+F11进入VBA编辑界面。

用宏代码破解密码:以office2007为例说明,(2003也是一样的,只是菜单命令的位置不同)

如何解除各版本excel工作表与工作薄保护密码 第2张

选择插入 ,点击进入 模块。

第一步、首先,打开Excel二次,打开被保护的Excel表格。在主界面界面上方选择“审阅”,点击打开

如何解除各版本excel工作表与工作薄保护密码 第3张

在右边Module的空白编辑区域,复制粘贴第五步中的所有内容,然后点击运行该VBA命令。

第一步,先找到一个带有有工作表保护密码的Excel工作表,然后把后缀名称改为.rar。第二步,用

如何解除各版本excel工作表与工作薄保护密码 第4张

Option Explicit

Excel,遗忘密码后如何撤销工作表保护密码工作表保护密码1、打开您需要撤销保护密码的Excel文件

Public SubAllInternalPasswords()

如何破解EXCEL工作表保护密码忘记密码怎么办1.新建一个EXCEL工作表,而后点击另存为,讲表格保

' Breaks worksheet and workbook structure passwords. Bob McCormick

首先打开你要清楚密码的工作表,点击那个有密码的工作簿,可以看到,现在这个工作簿有密码,是无法修改的,

' probably originator of base code algorithm modified for coverage

一、密码保护:Microsoft Excel中的密码保护提供了几种类型:利用密码以打开一个文档;

' of workbook structure / windows passwords and for multiple passwords

1、在进行编辑的excel地表的情况下中,那么就出现提示了无法进行编辑excel。2、然后需要进

'

' Norman Harker and JE McGimpsey 27-Dec-2002 (Version 1.1)

用宏代码破解密码:以office2007为例说明,(2003也是一样的,只是菜单命令的位置不同)

' Modified 2003-Apr-04 by JEM: All msgs to constants, and

' eliminate one Exit Sub (Version 1.1.1)

' Reveals hashed passwords NOT original passwords

Const DBLSPACE As String = vbNewLine & vbNewLine

Const AUTHORS As String = DBLSPACE & vbNewLine & _

"Adapted from Bob McCormick base code by" & _

"Norman Harker and JE McGimpsey"

Const HEADER As String = "AllInternalPasswords User Message"

Const VERSION As String = DBLSPACE & "Version 1.1.1 2003-Apr-04"

Const REPBACK As String = DBLSPACE & "Please report failure "& _

"to the microsoft.public.excel.programming newsgroup."

Const ALLCLEAR As String = DBLSPACE & "The workbook should "& _

"now be free of all password protection, so make sure you:" & _

DBLSPACE & "SAVE IT NOW!" & DBLSPACE & "andalso" & _

DBLSPACE & "BACKUP!, BACKUP!!, BACKUP!!!" & _

DBLSPACE & "Also, remember that the password was " & _

"put there for a reason. Don't stuff up crucial formulas " & _

"or data." & DBLSPACE & "Access and use of some data" & _

"may be an offense. If in doubt, don't."

Const MSGNOPWORDS1 As String = "There were no passwords on " & _

"sheets, or workbook structure or windows." & AUTHORS &VERSION

Const MSGNOPWORDS2 As String = "There was no protection to " & _

"workbook structure or windows." & DBLSPACE & _

"Proceeding to unprotect sheets." & AUTHORS & VERSION

Const MSGTAKETIME As String = "After pressing OK button this " &_

"will take some time." & DBLSPACE & "Amount of time" & _

"depends on how many different passwords, the " & _

"passwords, and your computer's specification." & DBLSPACE &_

"Just be patient! Make me a coffee!" & AUTHORS & VERSION

Const MSGPWORDFOUND1 As String = "You had a Worksheet " & _

"Structure or Windows Password set." & DBLSPACE & _

"The password found was: " & DBLSPACE & "$$" &DBLSPACE & _

"Note it down for potential future use in other workbooks by " &_

"the same person who set this password." & DBLSPACE & _

"Now to check and clear other passwords." & AUTHORS & VERSION

Const MSGPWORDFOUND2 As String = "You had a Worksheet " & _

"password set." & DBLSPACE & "The password found was:" & _

DBLSPACE & "$$" & DBLSPACE & "Note it down forpotential " & _

"future use in other workbooks by same person who " & _

"set this password." & DBLSPACE & "Now to check andclear " & _

"other passwords." & AUTHORS & VERSION

Const MSGONLYONE As String = "Only structure / windows " & _

"protected with the password that was just found." & _

ALLCLEAR & AUTHORS & VERSION & REPBACK

Dim w1 As Worksheet, w2 As Worksheet

Dim i As Integer, j As Integer, k As Integer, l As Integer

Dim m As Integer, n As Integer, i1 As Integer, i2 As Integer

Dim i3 As Integer, i4 As Integer, i5 As Integer, i6 As Integer

Dim PWord1 As String

Dim ShTag As Boolean, WinTag As Boolean

Application.ScreenUpdating =False

With ActiveWorkbook

WinTag = .ProtectStructure Or .ProtectWindows

End With

ShTag = False

For Each w1 InWorksheets

ShTag = ShTag Or w1.ProtectContents

Next w1

If Not ShTag And Not WinTag Then

MsgBox MSGNOPWORDS1, vbInformation, HEADER

Exit Sub

End If

MsgBox MSGTAKETIME, vbInformation, HEADER

If Not WinTag Then

MsgBox MSGNOPWORDS2, vbInformation, HEADER

Else

On Error Resume Next

Do 'dummy do loop

For i = 65 To 66: For j = 65 To 66: For k = 65 To 66

For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66

For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66

For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126

With ActiveWorkbook

.Unprotect Chr(i) & Chr(j) & Chr(k) & _

Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & _

Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)

If .ProtectStructure = False And _

.ProtectWindows = False Then

PWord1 = Chr(i) & Chr(j) & Chr(k) & Chr(l) & _

Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _

Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)

MsgBox Application.Substitute(MSGPWORDFOUND1, _

"$$", PWord1), vbInformation, HEADER

Exit Do 'Bypass all for...nexts

End If

End With

Next: Next: Next: Next: Next: Next

Next: Next: Next: Next: Next: Next

Loop Until True

On Error GoTo 0

End If

If WinTag And Not ShTag Then

MsgBox MSGONLYONE, vbInformation, HEADER

Exit Sub

End If

On Error Resume Next

For Each w1 InWorksheets

'Attempt clearance with PWord1

w1.Unprotect PWord1

Next w1

On Error GoTo 0

ShTag = False

For Each w1 InWorksheets

'Checks for all clear ShTag triggered to 1 if not.

ShTag = ShTag Or w1.ProtectContents

Next w1

If ShTag Then

For Each w1 InWorksheets

With w1

If .ProtectContents Then

On Error Resume Next

Do 'Dummy do loop

For i = 65 To 66: For j = 65 To 66: For k = 65 To 66

For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66

For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66

For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126

.Unprotect Chr(i) & Chr(j) & Chr(k) & _

Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _

Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)

If Not .ProtectContents Then

PWord1 = Chr(i) & Chr(j) & Chr(k) & Chr(l) & _

Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _

Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)

MsgBox Application.Substitute(MSGPWORDFOUND2, _

"$$", PWord1), vbInformation, HEADER

'leverage finding Pword by trying on other sheets

For Each w2 InWorksheets

w2.Unprotect PWord1

Next w2

Exit Do 'Bypass all for...nexts

End If

Next: Next: Next: Next: Next: Next

Next: Next: Next: Next: Next: Next

Loop Until True

On Error GoTo 0

End If

End With

Next w1

End If

MsgBox ALLCLEAR & AUTHORS & VERSION & REPBACK, vbInformation,HEADER

End Sub

第一步,先找到一个带有有工作表保护密码的Excel工作表,然后把后缀名称改为.rar。第二步,用压缩文件zhidao打开,然后找压缩的对应路径。第三步,把从压缩文件里面找到的.xml文件,然后拖拽出来,进行修改。第四步,把保护代码删除来撤消工作专表保护,找到这个.xml文件用记事本打开,然后搜索【protection】,把从<sheetprotection.........="0"/>的代码,全部删除掉,如图所示。第五步,然后再把刚刚修改后的属.xml文件,选择拖拽到压缩的工作表中替换掉。第六步,再把文件名称后缀改为.xlsx,打开Excel表格,密码保护就可以取消了。第七步,撤消保护工作表后,还可以在【审阅】选项下对工作表重新进行进行保护和撤消保护工作表操作,如图所示,原发布者:教技韦德文Excel,遗忘密码后如何撤销工作表保护密码工作表保护密码1、打开您需要撤销保护密码的Excel文件;2、依次点击菜单栏上的工具---宏----录制新宏,输入宏名字如:ab;3、停止录制(这样得到一个空宏);4、依次点击菜单栏上的工具---宏----宏,选ab,点编辑按7a64e58685e5aeb931333433623761钮;5、删除窗口中的所有字符(只有几个),替换为以下内容;PublicSub工作表保护密码()ConstDBLSPACEAsString=vbNewLine&vbNewLineConstAUTHORSAsString=DBLSPACE&vbNewLine&_"作者:eric"ConstHEADERAsString="工作表保护密码"ConstVERSIONAsString=DBLSPACE&"版本Version1.1.1"ConstREPBACKAsString=DBLSPACE&""ConstZHENGLIAsString=DBLSPACE&"eric"ConstALLCLEARAsString=DBLSPACE&"该工作簿中的工作表密码保护已全部解除。"&DBLSPACE&"请记得重新设置密码"_&DBLSPACE&"注意:此方法仅用于遗忘密码使用。"ConstMSGNOPWORDS1AsString="该文件工作表中没有加密"ConstMSGNOPWORDS2AsString="该文件工作表中没有加密2"ConstMSGTAKETIMEAsString="请耐心等候!"&DBLSPACE&"按确定开始回复"ConstMSGPWORDFOUND1AsString="密码重新组合为:"&DBLSPACE&"$$"&DBLSPACE&_"如果该文件工作表有不同密码,将搜索下一组密码并修改清除"ConstMSGPWORDFOUND2AsString="密码重新组合为:"&DBLSPACE&"$$"&DBLSPACE&_"如果该文件,解除工作表密码保护1、查知看代码步骤:右键【sheet1】-【查看代码】-打开代道码窗口。2、插版入代码代码:Sub DeletePW()ActiveSheet.Protect DrawingObjects:=True, Contents:=True, AllowFiltering:=TrueActiveSheet.Protect DrawingObjects:=False, Contents:=True, AllowFiltering:=TrueActiveSheet.Protect DrawingObjects:=True, Contents:=True, AllowFiltering:=TrueActiveSheet.Protect DrawingObjects:=False, Contents:=True, AllowFiltering:=TrueActiveSheet.UnprotectEnd Sub步骤:粘贴代码,点击【权运行】即可。来自网页链接,好简单的方法:1.打开保护密码的Excel文件2.复制工作表百内容3.新建工作表,在新工作表上点击鼠标右键——“度选择性粘贴” 注意是选择性粘贴——回弹出对话框,在粘贴中选择全部——确定。最后一步重要4.点击鼠标右键——“选择性粘贴” ——弹出对话框,在粘贴选项中选择列宽——确定。完成上面就是新建可以编写的工作表。希望能帮到你!不是保护工答作簿吧?保护工作簿这方法就无用了本回答被提问者采纳,原发布者:教技韦德文Excel,遗忘密码后如何撤销工作表保护密码工作表保护密码1、打开您需要撤销保护密码的Excel文件;2、依次点击菜单7a64e78988e69d8331333433623761栏上的工具---宏----录制新宏,输入宏名字如:ab;3、停止录制(这样得到一个空宏);4、依次点击菜单栏上的工具---宏----宏,选ab,点编辑按钮;5、删除窗口中的所有字符(只有几个),替换为以下内容;PublicSub工作表保护密码()ConstDBLSPACEAsString=vbNewLine&vbNewLineConstAUTHORSAsString=DBLSPACE&vbNewLine&_"作者:eric"ConstHEADERAsString="工作表保护密码"ConstVERSIONAsString=DBLSPACE&"版本Version1.1.1"ConstREPBACKAsString=DBLSPACE&""ConstZHENGLIAsString=DBLSPACE&"eric"ConstALLCLEARAsString=DBLSPACE&"该工作簿中的工作表密码保护已全部解除。"&DBLSPACE&"请记得重新设置密码"_&DBLSPACE&"注意:此方法仅用于遗忘密码使用。"ConstMSGNOPWORDS1AsString="该文件工作表中没有加密"ConstMSGNOPWORDS2AsString="该文件工作表中没有加密2"ConstMSGTAKETIMEAsString="请耐心等候!"&DBLSPACE&"按确定开始回复"ConstMSGPWORDFOUND1AsString="密码重新组合为:"&DBLSPACE&"$$"&DBLSPACE&_"如果该文件工作表有不同密码,将搜索下一组密码并修改清除"ConstMSGPWORDFOUND2AsString="密码重新组合为:"&DBLSPACE&"$$"&DBLSPACE&_"如果该文件,那不是说你工作薄保护问题,是说你的代码有错,破解工作表保护密码去除Excel工作表保护密码,很有用的7a64e4b893e5b19e31333337393632方法操作步骤:1. 打开需要破解密码的Excel;2. 按Alt+F11进入VBA编辑界面;3. 插入 -- 模块(Module);4. 在右边Module的空白编辑区域,复制粘贴下面所有内容5. F5,运行该VBA命令;---------------------(下面的内容在第四步复制进去)-------------------------Option ExplicitPublic SubAllInternalPasswords()' Breaks worksheet and workbook structure passwords. Bob McCormick' probably originator of base code algorithm modified for coverage' of workbook structure / windows passwords and for multiple passwords'' Norman Harker and JE McGimpsey 27-Dec-2002 (Version 1.1)' Modified 2003-Apr-04 by JEM: All msgs to constants, and' eliminate one Exit Sub (Version 1.1.1)' Reveals hashed passwords NOT original passwordsConst DBLSPACE As String = vbNewLine & vbNewLineConst AUTHORS As String = DBLSPACE & vbNewLine & _"Adapted from Bob McCormick base code by" & _"Norman Harker and JE McGimpsey"Const HEADER As String = "AllInternalPasswords User Message"Const VERSION As String = DBLSPACE & "Version 1.1.1 2003-Apr-04"Const REPBACK As String = DBLSPACE & "Please report failure "& _"to the microsoft.public.excel.programming newsgroup."Const ALLCLEAR As String = DBLSPACE & "The workbook should "& _"now be free of all password protection, so make sure you:" & _DBLSPACE & "SAVE IT NOW!" & DBLSPACE & "andalso" & _DBLSPACE & "BACKUP!, BACKUP!!, BACKUP!!!" & _DBLSPACE & "Also, remember that the password was " & _"put there for a reason. Don't stuff up crucial formulas " & _"or data." & DBLSPACE & "Access and use of some data" & _"may be an offense. If in doubt, don't."Const MSGNOPWORDS1 As String = "There were no passwords on " & _"sheets, or workbook structure or windows." & AUTHORS &VERSIONConst MSGNOPWORDS2 As String = "There was no protection to " & _"workbook structure or windows." & DBLSPACE & _"Proceeding to unprotect sheets." & AUTHORS & VERSIONConst MSGTAKETIME As String = "After pressing OK button this " &_"will take some time." & DBLSPACE & "Amount of time" & _"depends on how many different passwords, the " & _"passwords, and your computer's specification." & DBLSPACE &_"Just be patient! Make me a coffee!" & AUTHORS & VERSIONConst MSGPWORDFOUND1 As String = "You had a Worksheet " & _"Structure or Windows Password set." & DBLSPACE & _"The password found was: " & DBLSPACE & "$$" &DBLSPACE & _"Note it down for potential future use in other workbooks by " &_"the same person who set this password." & DBLSPACE & _"Now to check and clear other passwords." & AUTHORS & VERSIONConst MSGPWORDFOUND2 As String = "You had a Worksheet " & _"password set." & DBLSPACE & "The password found was:" & _DBLSPACE & "$$" & DBLSPACE & "Note it down forpotential " & _"future use in other workbooks by same person who " & _"set this password." & DBLSPACE & "Now to check andclear " & _"other passwords." & AUTHORS & VERSIONConst MSGONLYONE As String = "Only structure / windows " & _"protected with the password that was just found." & _ALLCLEAR & AUTHORS & VERSION & REPBACKDim w1 As Worksheet, w2 As WorksheetDim i As Integer, j As Integer, k As Integer, l As IntegerDim m As Integer, n As Integer, i1 As Integer, i2 As IntegerDim i3 As Integer, i4 As Integer, i5 As Integer, i6 As IntegerDim PWord1 As StringDim ShTag As Boolean, WinTag As BooleanApplication.ScreenUpdating =FalseWith ActiveWorkbookWinTag = .ProtectStructure Or .ProtectWindowsEnd WithShTag = FalseFor Each w1 InWorksheetsShTag = ShTag Or w1.ProtectContentsNext w1If Not ShTag And Not WinTag ThenMsgBox MSGNOPWORDS1, vbInformation, HEADERExit SubEnd IfMsgBox MSGTAKETIME, vbInformation, HEADERIf Not WinTag ThenMsgBox MSGNOPWORDS2, vbInformation, HEADERElseOn Error Resume NextDo 'dummy do loopFor i = 65 To 66: For j = 65 To 66: For k = 65 To 66For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126With ActiveWorkbook.Unprotect Chr(i) & Chr(j) & Chr(k) & _Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & _Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)If .ProtectStructure = False And _.ProtectWindows = False ThenPWord1 = Chr(i) & Chr(j) & Chr(k) & Chr(l) & _Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)MsgBox Application.Substitute(MSGPWORDFOUND1, _"$$", PWord1), vbInformation, HEADERExit Do 'Bypass all for...nextsEnd IfEnd WithNext: Next: Next: Next: Next: NextNext: Next: Next: Next: Next: NextLoop Until TrueOn Error GoTo 0End IfIf WinTag And Not ShTag ThenMsgBox MSGONLYONE, vbInformation, HEADERExit SubEnd IfOn Error Resume NextFor Each w1 InWorksheets'Attempt clearance with PWord1w1.Unprotect PWord1Next w1On Error GoTo 0ShTag = FalseFor Each w1 InWorksheets'Checks for all clear ShTag triggered to 1 if not.ShTag = ShTag Or w1.ProtectContentsNext w1If ShTag ThenFor Each w1 InWorksheetsWith w1If .ProtectContents ThenOn Error Resume NextDo 'Dummy do loopFor i = 65 To 66: For j = 65 To 66: For k = 65 To 66For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126.Unprotect Chr(i) & Chr(j) & Chr(k) & _Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)If Not .ProtectContents ThenPWord1 = Chr(i) & Chr(j) & Chr(k) & Chr(l) & _Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)MsgBox Application.Substitute(MSGPWORDFOUND2, _"$$", PWord1), vbInformation, HEADER'leverage finding Pword by trying on other sheetsFor Each w2 InWorksheetsw2.Unprotect PWord1Next w2Exit Do 'Bypass all for...nextsEnd IfNext: Next: Next: Next: Next: NextNext: Next: Next: Next: Next: NextLoop Until TrueOn Error GoTo 0End IfEnd WithNext w1End IfMsgBox ALLCLEAR & AUTHORS & VERSION & REPBACK, vbInformation,HEADEREnd Sub本回答被提问者和网友采纳,表格发给我.帮你取消密码.947100086@qq.com,忘记密码了就没办法了内容来自www.51dongshi.com请勿采集。

热门标签