如何取消Excel工作表密码保护教程
ex-vba迄今为止最简单的excel工作表密码解除方法
ex-vba迄今为止最简单的excel工作表密码解除方法
『动画解读』
对于设置了工作表密码的工作簿,打开后,具体操作步骤如下:
Step-01:通过菜单【开发工具】-【Visual Basic】进入VBA 编辑界面
Step-02:在VBA编辑窗口的【立即窗口】中逐步执行以下代码(输完一句回车后再输入另一句并回车其中sheet1为需要破解密码的工作表的名称)sheet1.Protect AllowFiltering:=truesheet1.unProtect
逐步执行这两行代码后,工作表的密码将被解除!!!
如果打开VBA编辑窗口时没有立即窗口,可以通过菜单【视图】-【立即窗口】调出来,如下图所示:
『扩展应用』如果需要批量解除的,可以自行加入循环控制语句,写成一个过程。
代码参考如下(将代码复制放在ThisWorkbook下,然后运行):Sub clsWkShtPwd() Dim sht As Worksheet For Each sht In Worksheets
sht.Protect AllowFiltering:=True sht.unprotect NextEnd Sub
在此再次感谢大神们的分享!同时,一门技术是好是坏,全凭个人掌握,用于益处是为好……。
excel表格如何解除保护密码
excel表格如何解除保护密码
在Excel中录入过多的重要数据是人们的习惯,因此这些文件都需要利用密码进行保护。
但过了段时间以后却觉得不需要进行保护。
就需要解除密码保护了。
接下来店铺举例简单的例子告诉大家解除excel 表格密码保护的方法。
解除excel表格密码保护的方法
解除密码步骤1:先录入密码,确定打开要取消密码的excel文件。
解除密码步骤2:在文件菜单下点击另存为,取消密码的办法其实就是再把文件保存一次,在保存替换原文件或重命名时将密码取消掉。
解除密码步骤3:点击工具选择常规选项
解除密码步骤4:删除密码,点击确定并保存。
解除密码步骤5:提示文件已存在要替换它吗?如果想要覆盖原文件直接点击是就替换掉了。
解除密码步骤6:如果想保留原文件重新存一份,点击否再修改文件名保存为一份新的文件。
如何解除excel密码
精心整理Excel—“撤销工作表保护密码”的破解并获取原始密码在日常工作中,您是否遇到过这样的情况:您用Excel编制的报表、表格、程序等,在单元格中设置了公式、函数等,为了防止其他人修改您的设置或者防止您自己无意中修改,您可能会使用Excel的工作表保护功能,但时间久了保护密码容易忘记,这该怎么办?有时您从网上下载的Excel格式的小程序,您想修改,但是作者加了工作表保护密码,破!1、打开您需要破解保护密码的Excel2、依次点击菜单栏上的工具---宏----3、停止录制(这样得到一个空宏);45、删除窗口中的所有字符PublicSubAllInternalPasswords()'Breaksworksheetandworkbookstructurepasswords.BobMcCormick'probablyoriginatorofbasecodealgorithmmodifiedforcoverage'ofworkbookstructure/windowspasswordsandformultiplepasswords''NormanHarkerandJEMcGimpsey27-Dec-2002(Version1.1)'Modified2003-Apr-04byJEM:Allmsgstoconstants,and'RevealshashedpasswordsNOToriginalpasswords ConstDBLSPACEAsString=vbNewLine&vbNewLine ConstAUTHORSAsString=DBLSPACE&vbNewLine&_ "AdaptedfromBobMcCormickbasecodeby"&_"NormanHarkerandJEMcGimpsey""maybeanoffense.Ifindoubt,don't." ConstMSGNOPWORDS1AsString="Therewerenopasswordson"&_ "sheets,orworkbookstructureorwindows."&AUTHORS&VERSION ConstMSGNOPWORDS2AsString="Therewasnoprotectionto"&_ "workbookstructureorwindows."&DBLSPACE&_ "Proceedingtounprotectsheets."&AUTHORS&VERSIONConstMSGTAKETIMEAsString="AfterpressingOKbuttonthis"&_ "willtakesometime."&DBLSPACE&"Amountoftime"&_ "dependsonhowmanydifferentpasswords,the"&_ "passwords,andyourcomputer'sspecification."&DBLSPACE&_ "Justbepatient!Makemeacoffee!"&AUTHORS&VERSION ConstMSGPWORDFOUND1AsString="YouhadaWorksheet"&_ConstMSGONLYONEAsString="Onlystructure/windows"&_ "protectedwiththepasswordthatwasjustfound."&_ ALLCLEAR&AUTHORS&VERSION&REPBACKDimw1AsWorksheet,w2AsWorksheetDimiAsInteger,jAsInteger,kAsInteger,lAsInteger DimmAsInteger,nAsInteger,i1AsInteger,i2AsIntegerDimi3AsInteger,i4AsInteger,i5AsInteger,i6AsInteger DimPWord1AsStringDimShTagAsBoolean,WinTagAsBooleanApplication.ScreenUpdating=False WithActiveWorkbookWinTag=.ProtectStructureOr.ProtectWindowsEndWithShTag=FalseForEachw1InWorksheetsShTag=ShTagOrw1.ProtectContentsNextw1ExitSubEndIfMsgBoxMSGNOPWORDS2,vbInformation,HEADERElseOnErrorResumeNextDo'dummydoloopFori=65To66:Forj=65To66:Fork=65To66Forl=65To66:Form=65To66:Fori1=65To66Fori2=65To66:Fori3=65To66:Fori4=65To66 Fori5=65To66:Fori6=65To66:Forn=32To126 WithActiveWorkbook.UnprotectChr(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=FalseAnd_.ProtectWindows=FalseThenChr(m)&Chr(i1)&Chr(i2)&Chr(i3)&_Chr(i4)&Chr(i5)&Chr(i6)&Chr(n)EndIfEndWithNext:Next:Next:Next:Next:Next LoopUntilTrueOnErrorGoTo0EndIfIfWinTagAndNotShTagThen MsgBoxMSGONLYONE,vbInformation,HEADERExitSubEndIfOnErrorResumeNextForEachw1InWorksheets'AttemptclearancewithPWord1w1.UnprotectPWord1Nextw1OnErrorGoTo0ShTag=FalseForEachw1InWorksheetsNextw1IfShTagThenWithw1OnErrorResumeNextDo'DummydoloopFori=65To66:Forj=65To66:Fork=65To66 Forl=65To66:Form=65To66:Fori1=65To66 Fori2=65To66:Fori3=65To66:Fori4=65To66 Fori5=65To66:Fori6=65To66:Forn=32To126.UnprotectChr(i)&Chr(j)&Chr(k)&_Chr(l)&Chr(m)&Chr(i1)&Chr(i2)&Chr(i3)&_ Chr(i4)&Chr(i5)&Chr(i6)&Chr(n)IfNot.ProtectContentsThenPWord1=Chr(i)&Chr(j)&Chr(k)&Chr(l)&_ Chr(m)&Chr(i1)&Chr(i2)&Chr(i3)&_Chr(i4)&Chr(i5)&Chr(i6)&Chr(n)"$$",PWord1),vbInformation,HEADERForEachw2InWorksheetsw2.UnprotectPWord1Nextw2EndIfLoopUntilTrueOnErrorGoTo0EndIfEndWithNextw1EndIfMsgBoxALLCLEAR&AUTHORS&VERSION&REPBACK,vbInformation,HEADEREndSub-----------------------------------------------------------------------------------------复制到横线以上6、关闭编辑窗口;7、依次点击菜单栏上的工具---宏-----,确定两次;等一会,就会出现以下对话框:这就是大写):再点击确定。
如何撤销工作表保护
E x c e l密码保护的解除方法与解除原理出现这种情况,应该怎么解决呢?经过研究,找到了两种破解Excel工作表保护码的方法。
一、VBA宏代码破解法:第一步:打开该文件,先解除默认的“宏禁用”状态,方法是点击工具栏下的“选项”状态按钮,打开“MicrosoftOffice安全选项”窗口,选择其中的“启用此内容”,“确定”退出(图2);再切换到“视图”选项卡,点击“宏”→“录制宏”,出现“录制新宏”窗口,在“宏名”定义一个名称为:PasswordBreaker(图3),点击“确定”退出;第二步:再点击“宏”→“查看宏”,选择“宏名”下的“PasswordBreaker”并点击“编辑”,打开“MicrosoftVisualBasic”编辑器,用如下内容替换右侧窗口中的所有代码:SubPasswordBreaker()DimiAsInteger,jAsInteger,kAsIntegerDimlAsInteger,mAsInteger,nAsIntegerDimi1AsInteger,i2AsInteger,i3AsIntegerDimi4AsInteger,i5AsInteger,i6AsIntegerOnErrorResumeNextFori=65To66:Forj=65To66:Fork=65To66Forl=65To66:Form=65To66:Fori1=65To66Fori2=65To66:Fori3=65To66:Fori4=65To66Fori5=65To66:Fori6=65To66:Forn=32To126(i)&Chr(j)&Chr(k)&_Chr(l)&Chr(m)&Chr(i1)&Chr(i2)&Chr(i3)&_Chr(i4)&Chr(i5)&Chr(i6)&Chr(n)=FalseThenMsgBox"Oneusablepasswordis"&Chr(i)&Chr(j)&_Chr(k)&Chr(l)&Chr(m)&Chr(i1)&Chr(i2)&_Chr(i3)&Chr(i4)&Chr(i5)&Chr(i6)&Chr(n)(1).SelectRange("a1").FormulaR1C1=Chr(i)&Chr(j)&_Chr(k)&Chr(l)&Chr(m)&Chr(i1)&Chr(i2)&_Chr(i3)&Chr(i4)&Chr(i5)&Chr(i6)&Chr(n)ExitSubEndIfNext:Next:Next:Next:Next:NextNext:Next:Next:Next:Next:NextEndSub第三步:再点击“宏”→“查看宏”,选择“宏名”下的“PasswordBreaker”并点击“执行”,密码就现形了(图4)。
取消excel保护的方法图解步骤
取消excel保护的方法图解步骤在Excel中输入过多的重要数据时大家的习惯,这个时候就需要利用密码进行保护,到了后面发现已经不太重要了,这个时候就可以取消密码保护了,下面是由店铺分享的如何取消excel保护的教程,希望对你有用。
取消excel保护的教程取消步骤1:首先打开Excel2010,选中任意一个单元格,然后鼠标“右键”--“设置单元格格式”取消步骤2:在跳出的“设置单元格窗口”中选择“保护”选项卡,在这里我们可以看到默认情况下“锁定”复选框是被勾上的,说明所有单元格都是默认被勾上的取消excel保护的教程步骤图2取消步骤3:那么我们要把所有单元格“锁定”的复选框的勾都取消掉先。
取消步骤4:按Ctrl+A快捷键选中所有单元格,接着再鼠标“右键”--“设置单元格格式”,选择“保护”选项卡,把“锁定”前面的小方框去勾,单击“确定”按钮保存设置取消excel保护的教程步骤图3取消步骤5:然后选择需要保护的单元格区域,按上面操作去把“锁定”复选框勾上取消excel保护的教程步骤图4取消步骤6:接下来选择“审阅”选项卡,在“更改”组中单击“保护工作表”取消excel保护的教程步骤图5取消步骤7:在跳出来的“保护工作表”窗口中,输入密码“取消工作表保护时所需要的”,并且第一二项选勾(默认是选勾上的),确认提交取消excel保护的教程步骤图6取消步骤8:下一步再次输入密码(跟上一步一样密码),确认提交取消excel保护的教程步骤图7取消步骤9:完成上面步骤后,随便选一个保护的单元格双击进行编辑,就会跳出一个提示框编辑不了。
取消excel保护的教程步骤图8取消步骤10:保护工作表后如果自己要重新编辑了怎么办呢?这个时候要先“撤销工作表保护”选择“审阅”选项卡,在“更改”组中单击“撤销工作表保护”,在跳出的窗口中输入“密码”,确认提交就可以取消。
我们又可以自由编辑了。
取消excel保护的教程步骤图9。
如何能取消Excel工作表密码保护教程
Excel工作表保护密码清除1,打开需要解除保护的EXCEL工作表;2,选择工具---宏----录制新宏---输入名字如:aa;3,停止录制(这样得到一个空宏);4,工具---宏----宏,选aa,点编辑按钮;5,删除窗口中的所有字符(只有几个),替换为下面的内容:(复制吧);6,关闭编辑窗口;7,工具---宏-----宏,选AllInternalPasswords,运行,确定两次,等2分钟,再确定.OK,旧的密码自动提示,工作表也自动解除保护了。
内容如下:==================================================================================Public 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 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 & "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 & 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 & 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 & 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 Integer Dim PWord1 As StringDim ShTag As Boolean, WinTag As BooleanApplication.ScreenUpdating = FalseWith ActiveWorkbookWinTag = .ProtectStructure Or .ProtectWindowsEnd WithShTag = FalseFor Each w1 In WorksheetsShTag = 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 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 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 In Worksheets'Attempt clearance with PWord1w1.Unprotect PWord1Next w1On Error GoTo 0ShTag = FalseFor Each w1 In Worksheets'Checks for all clear ShTag triggered to 1 if not. ShTag = ShTag Or w1.ProtectContentsNext w1If ShTag ThenFor Each w1 In WorksheetsWith w1If .ProtectContents ThenOn Error Resume NextDo 'Dummy do loopFor 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 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 In Worksheetsw2.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============================================================================== Excel表格密码保护的解除方法表格受密码保护时,我们修改数据Excel弹出“您试图更改的单元格或图表受保护,因而是只读的。
Excel撤销工作表保护密码图文教程介绍
r workbooks by same person who " & _"set this password." & DBLSPACE &
"Now to check and clear " & _"other passwords." & AUTHORS & VERSIONCo
nst MSGonLYONE As String="only structure / windows " & _"protected wit
rotection, 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.
or 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.Unprotec
t Chr(i) & Chr(j) & Chr(k) & _Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & _C
excel2007取消密码保护教程
excel2007取消密码保护教程
在Excel中有些设置了密码保护的Excel文档不再需要被密码所保护了,这个时候就需要取消密码的保护了,具体该如何取消密码保护呢?接下来是店铺为大家带来的excel2007 取消密码保护教程,供大家参考。
excel2007 取消密码保护教程:
取消密码保护步骤1:点击0ffice按钮-准备-加密文档
取消密码保护步骤2:删除密码-确定
取消密码保护步骤3:取消工作表保护
取消密码保护步骤4:如果Excel2007工作表已保护起来,“保护工作表”按钮将自动变化为“取消工作表保护”,我们可以单击该按钮,再输入前面的密码即可取消保护工作表。
如何解除excel保护的方法
如何解除excel保护的方法
在Excel中经常需要用到密码保护对重要数据的文档进行保护,但时间久了觉得不重要就需要解除保护。
下面是店铺带来的关于如何解除excel保护的方法,欢迎阅读!
如何解除excel保护的方法:
解除保护步骤1:如果再在工作表页面中输入数据或修改数据时,会弹出该工作表被保护的提示信息。
解除保护步骤2:当想编辑该文档的时候,执行取消保护工作表操作就可以了。
和设定保护工作表时的操作类似,打开要编辑的excel文档,选择审阅,可以看到原来“保护工作表”的工具变为“撤销保护工作表”的工具
解除保护步骤3:点击“撤销保护工作表”按钮,会弹出“撤销保护工作表”对话框,在编辑框中输入设定“保护工作表”时的密码,然后点击“确定”按钮。
Excel 表格怎么去掉保护密码
"now be free of all password protection, so make sure you:" & _
DBLSPACE & "SAVE IT NOW!" & DBLSPACE & "and also" & _
"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 " & _
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
ShTag = ShTag Or w1.ProtectContents
Next w1
If ShTag Then
For Each w1 In Worksheets
With w1
excel2007保护密码怎么去掉
excel2007保护密码怎么去掉Excel中经常需要把保护功能给取消掉,取消保护具体该如何操作呢?接下来是店铺为大家带来的excel2007取消保护密码的教程,希望小编整理的资料对大家有帮助。
excel2007取消保护密码的方法取消保护步骤1:单元格保护默认地,所有单元格都有锁定属性,一旦将Excel2007工作表保护起来,则不能在这些单元格里输入任何数据,为此,我们得取消部分单元格的锁定属性。
首先,右键单击工作表的行、列交界处,这一操作将产生两个结果:选中所有单元格和弹出快捷菜单;然后单击“设置单元格格式”,如图13所示。
图13 准备设置单元格格式接着,在弹出的对话框中单击“保护”以切换到该标签页,如图14所示。
图14 自定义设置然后,勾选“锁定”和“隐藏”后单击“确定”,退出设置状态并返回Excel编辑界面。
取消保护步骤2:取消部分单元格的保护状态选中对象单元格区域,右键单击,选择“设置单元格格式”,如图15所示;图15 设置准备然后按照前面的操作,清除“锁定”和“隐藏”前的钩,如图16所示。
图16 清除单元格的保护状态取消保护步骤3:保护工作表首先,单击“审阅”切换到该工具面板;接着,单击“保护工作表”;然后两次输入密码(两次的密码必须相同);最后单击“确定”即可,如图17所示。
图17 输入密码取消保护步骤4:检验保护效果在这些单元格里输入数据,会得到图18所示的拒绝对话框。
这样,我们就只能在没有保护的单元格中输入数据,这样既不影响成绩统计表的正常使用,又有效地保护了工作表不被误操作破坏。
图18 部分单元格保护起来了取消保护步骤5:取消工作表保护如果Excel2007工作表已保护起来,“保护工作表”按钮将自动变化为“取消工作表保护”,我们可以单击该按钮,再输入前面的密码即可取消保护工作表,如图19所示。
Excel密码保护的解除方法与解除原理
Excel密码保护的解除方法与解除原理2010-06-22 20:21Excel弹出“您试图更改的单元格或图表受保护,因而是只读的。
若要修改受保护单元格或图表,请先使用‘撤消工作表保护’命令(在‘审阅’选项卡的‘更改’组中)来取消保护。
可能会提示您输入密码。
”窗口,如图1。
出现这种情况,应该怎么解决呢?经过研究,找到了两种破解Excel工作表保护码的方法。
一、VBA宏代码破解法:第一步:打开该文件,先解除默认的“宏禁用”状态,方法是点击工具栏下的“选项”状态按钮,打开“Microsoft Office安全选项”窗口,选择其中的“启用此内容”,“确定”退出(图2);再切换到“视图”选项卡,点击“宏”→“录制宏”,出现“录制新宏”窗口,在“宏名”定义一个名称为:PasswordBreaker(图3),点击“确定”退出;第二步:再点击“宏”→“查看宏”,选择“宏名”下的“PasswordBreaker”并点击“编辑”,打开“MicrosoftVisualBasic”编辑器,用如下内容替换右侧窗口中的所有代码:Sub PasswordBreaker()Dim i As Integer, j As Integer, k As IntegerDim l As Integer, m As Integer, n As IntegerDim i1 As Integer, i2 As Integer, i3 As IntegerDim i4 As Integer, i5 As Integer, i6 As IntegerOn Error Resume NextFor 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 66 For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126 ActiveSheet.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 ActiveSheet.ProtectContents = False ThenMsgBox "One usable password is " & Chr(i)& Chr(j) & _Chr(k) & Chr(l) & Chr(m)& Chr(i1) & Chr(i2)& _Chr(i3) & Chr(i4) & Chr(i5)& Chr(i6) & Chr(n)ActiveWorkbook.Sheets(1).SelectRange("a1").FormulaR1C1 = Chr(i) & Chr(j)& _Chr(k) & Chr(l) & Chr(m)& Chr(i1) & Chr(i2)& _Chr(i3) & Chr(i4) & Chr(i5)& Chr(i6) & Chr(n)Exit SubEnd IfNext: Next: Next: Next: Next: NextNext: Next: Next: Next: Next: NextEnd Sub第三步:再点击“宏”→“查看宏”,选择“宏名”下的“PasswordBreaker”并点击“执行”,密码就现形了(图4)。
excel表格保护如何关闭
excel表格保护如何关闭
Office办公软件在安全方面做的非常完美,因为是办公软件,所以经常可能会设计到公司机密和隐私等。
因此,微软在开发Office每个版本的时候都会有给文件加密的功能,下面让店铺为你带来excel表格设置保护与关闭保护的方法。
excel保护关闭步骤如下:
打开要保护的excel
选择“审阅”选项,可以在该页面的工具栏上看到有一个“保护工作表”的工具栏
点击该按钮,打开“保护工作表”对话框。
在该对话框中,需要设定一个取消保护工作表时的密码,以及保护工作表后,允许进行的操作,将允许的操作前面的复选框选中,即点击打上“√”
点击“确定”按钮,弹出确定密码的对话框,输入“保护工作表”页面中设定的密码,然后点击确定
此时,如果再在工作表页面中输入数据或修改数据时,会弹出该工作表被保护的提示信息。
当想编辑该文档的时候,执行取消保护工作表操作就可以了。
和设定保护工作表时的操作类似,打开要编辑的excel文档,选择审阅,可以看到原来“保护工作表”的工具变为“撤销保护工作表”的工具点击“撤销保护工作表”按钮,会弹出“撤销保护工作表”对话框,在编辑框中输入设定“保护工作表”时的密码,然后点击“确定”按钮
关于excel保护关闭的相关文章推荐:。
撤销工作表保护密码是多少
撤销工作表保护密码是多少工作表保护密码是指在Excel中对工作表进行保护,以防止未经授权的用户对工作表进行修改或删除。
当工作表被保护后,用户需要输入密码才能对工作表进行编辑或格式更改。
然而,有时候我们可能会忘记或需要撤销工作表保护密码,那么该怎么办呢?撤销工作表保护密码的方法有多种,下面将介绍几种常用的方法:方法一,使用已知密码进行撤销。
如果你之前设置了工作表保护密码,并且还记得这个密码,那么撤销工作表保护密码就非常简单了。
只需要按照以下步骤操作即可:1. 打开Excel文档,找到被保护的工作表。
2. 在工作表上方的菜单栏中点击“审阅”选项卡。
3. 在“审阅”选项卡中找到“保护工作表”按钮,并点击下拉箭头。
4. 在弹出的选项中选择“撤销工作表保护”,然后输入之前设置的密码。
5. 点击“确定”即可完成撤销工作表保护密码的操作。
方法二,使用VBA代码进行撤销。
如果你忘记了工作表保护密码,或者无法使用已知密码进行撤销,那么可以尝试使用VBA代码来进行撤销。
下面是具体的操作步骤:1. 打开Excel文档,按下“Alt + F11”组合键,打开VBA编辑器。
2. 在VBA编辑器中,依次展开“VBAProject”、“Microsoft Excel Objects”文件夹,找到需要撤销保护的工作表。
3. 在工作表的代码窗口中输入以下VBA代码:Sub UnprotectSheet()。
Dim ws As Worksheet。
Set ws = ThisWorkbook.Sheets("Sheet1") '将“Sheet1”替换为你需要撤销保护的工作表名称。
ws.Unprotect "password" '将“password”替换为你设置的密码。
End Sub。
4. 点击运行按钮执行代码,即可完成撤销工作表保护密码的操作。
方法三,使用第三方工具进行撤销。
EXCEL忘记密码怎么办EXCEL工作表怎么清除密码
E X C E L忘记密码怎么办E X C E L工作表怎么清除密码集团标准化办公室:[VV986T-J682P28-JP266L8-68PNN]如何破解EXCEL工作表保护密码1.工具---宏----录制新宏---输入名字如:hh2. 3停止录制(这样得到一个空宏)3. 4工具---宏----宏,选hh,点编辑按钮选择“个人宏工作簿”后按确定,弹出如下“暂停”按钮,点击停止:1.点击“运行”按钮后,弹出“宏”对话框,2.点击运行“!工作保护密码破解”这个宏3.99、运行“!工作保护密码破解”这个宏后,如下图示意就可以解除工作表的密码保护了4.10(这个图,如果工作表中有多组不同密码,每解开一组,就会提示一次,也就说可能会出现几次)5.11工作表保护密码破解(代码)=========请复制以下内容=============Public Sub 工作表保护密码破解()Const DBLSPACE As String = vbNewLine & vbNewLine Const AUTHORS As String = DBLSPACE & vbNewLine & _ "作者:McCormick JE McGimpsey "Const HEADER As String = "工作表保护密码破解"Const VERSION As String = DBLSPACE & "版本 Version " Const REPBACK As String = DBLSPACE & ""Const ZHENGLI As String = DBLSPACE & " hfhzi3—戊冥整理"Const ALLCLEAR As String = DBLSPACE & "该工作簿中的工作表密码保护已全部解除!!" & DBLSPACE & "请记得另保存" _& DBLSPACE & "注意:不要用在不当地方,要尊重他人的劳动成果!"Const MSGNOPWORDS1 As String = "该文件工作表中没有加密"Const MSGNOPWORDS2 As String = "该文件工作表中没有加密2"Const MSGTAKETIME As String = "解密需花费一定时间,请耐心等候!" & DBLSPACE & "按确定开始破解!"Const MSGPWORDFOUND1 As String = "密码重新组合为:" & DBLSPACE & "$$" & DBLSPACE & _"如果该文件工作表有不同密码,将搜索下一组密码并修改清除"Const MSGPWORDFOUND2 As String = "密码重新组合为:" & DBLSPACE & "$$" & DBLSPACE & _"如果该文件工作表有不同密码,将搜索下一组密码并解除"Const MSGONLYONE As String = "确保为唯一的"Dim 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 Boolean= FalseWith ActiveWorkbookWinTag = .ProtectStructure Or .ProtectWindowsEnd WithShTag = FalseFor Each w1 In WorksheetsShTag = ShTag OrNext w1If Not ShTag And Not WinTag ThenMsgBox MSGNOPWORDS1, vbInformation, HEADERExit SubEnd IfMsgBox MSGTAKETIME, vbInformation, HEADERIf Not WinTag ThenElseOn Error Resume NextDo 'dummy do loopFor 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 66For 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 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 (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 In Worksheets'Attempt clearance with PWord1PWord1Next w1On Error GoTo 0ShTag = FalseFor Each w1 In Worksheets'Checks for all clear ShTag triggered to 1 if not. ShTag = ShTag OrNext w1If ShTag ThenFor Each w1 In WorksheetsWith w1If .ProtectContents ThenOn Error Resume NextDo 'Dummy do loopFor 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 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 (MSGPWORDFOUND2, _"$$", PWord1), vbInformation, HEADER'leverage finding Pword by trying on other sheetsFor Each w2 In WorksheetsPWord1Next 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 & ZHENGLI, vbInfo rmation, HEADEREnd Sub。
如何解除e cel密码
Excel—“撤销工作表保护密码”的破解并获取原始密码在日常工作中,您是否遇到过这样的情况:您用Excel编制的报表、表格、程序等,在单元格中设置了公式、函数等,为了防止其他人修改您的设置或者防止您自己无意中修改,您可能会使用Excel的工作表保护功能,但时间久了保护密码容易忘记,这该怎么办?有时您从网上下载的Excel格式的小程序,您想修改,但是作者加了工作表保护密码,怎么办?您只要按照以下步骤操作,Excel工作表保护密码瞬间即破!1、打开您需要破解保护密码的Excel文件;2、依次点击菜单栏上的工具---宏----录制新宏,输入宏名字如: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' Modified 2003-Apr-04 by JEM: All msgs to constants, and' eliminate one Exit Sub (Version' 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 2003-Apr-04"Const REPBACK As String = DBLSPACE & "Please report failure " & _"to the 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 & 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 & 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 & 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 Boolean= FalseWith ActiveWorkbookWinTag = .ProtectStructure Or .ProtectWindowsEnd WithShTag = FalseFor Each w1 In WorksheetsShTag = ShTag OrNext 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 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 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 (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, HEADER Exit SubEnd IfOn Error Resume NextFor Each w1 In Worksheets'Attempt clearance with PWord1PWord1Next w1On Error GoTo 0ShTag = FalseFor Each w1 In Worksheets'Checks for all clear ShTag triggered to 1 if not. ShTag = ShTag OrNext w1If ShTag ThenFor Each w1 In WorksheetsWith 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 (MSGPWORDFOUND2, _"$$", PWord1), vbInformation, HEADER'leverage finding Pword by trying on other sheetsFor Each w2 In WorksheetsPWord1Next 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-----------------------------------------------------------------------------------------复制到横线以上6、关闭编辑窗口;7、依次点击菜单栏上的工具---宏-----宏,选AllInternalPasswords,运行,确定两次;等一会,就会出现以下对话框:这就是Excel密码对应的原始密码(此密码和原先设置的密码都能打开此文档。
教你如何撤销工作表保护密码
Excel,遗忘密码后如何撤销工作表保护密码工作表保护密码1、打开您需要撤销保护密码的Excel文件;2、依次点击菜单栏上的工具---宏----录制新宏,输入宏名字如:ab;3、停止录制(这样得到一个空宏);4、依次点击菜单栏上的工具---宏----宏,选ab,点编辑按钮;5、删除窗口中的所有字符(只有几个),替换为以下内容;Public Sub 工作表保护密码()Const DBLSPACE As String = vbNewLine & vbNewLineConst AUTHORS As String = DBLSPACE & vbNewLine & _"作者:eric"Const HEADER As String = "工作表保护密码"Const VERSION As String = DBLSPACE & "版本Version 1.1.1"Const REPBACK As String = DBLSPACE & ""Const ZHENGLI As String = DBLSPACE & " eric"Const ALLCLEAR As String = DBLSPACE & "该工作簿中的工作表密码保护已全部解除。
" & DBLSPACE & "请记得重新设置密码" _& DBLSPACE & "注意:此方法仅用于遗忘密码使用。
"Const MSGNOPWORDS1 As String = "该文件工作表中没有加密"Const MSGNOPWORDS2 As String = "该文件工作表中没有加密2"Const MSGTAKETIME As String = "请耐心等候!" & DBLSPACE & "按确定开始回复"Const MSGPWORDFOUND1 As String = "密码重新组合为:" & DBLSPACE & "$$" & DBLSPACE & _"如果该文件工作表有不同密码,将搜索下一组密码并修改清除"Const MSGPWORDFOUND2 As String = "密码重新组合为:" & DBLSPACE & "$$" & DBLSPACE & _"如果该文件工作表有不同密码,将搜索下一组密码并解除"Const MSGONL YONE As String = "确保为唯一的?"Dim 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 In WorksheetsShTag = ShTag Or w1.ProtectContentsNext w1If Not ShTag And Not WinTag ThenMsgBox MSGNOPWORDS1, vbInformation, HEADER Exit SubEnd IfMsgBox MSGTAKETIME, vbInformation, HEADERIf Not WinTag ThenElseOn 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 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 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 MSGONL YONE, vbInformation, HEADERExit SubEnd IfOn Error Resume NextFor Each w1 In Worksheets'Attempt clearance with PWord1w1.Unprotect PWord1Next w1On Error GoTo 0ShTag = FalseFor Each w1 In Worksheets'Checks for all clear ShTag triggered to 1 if not.ShTag = ShTag Or w1.ProtectContentsNext w1If ShTag ThenFor Each w1 In WorksheetsWith 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 In Worksheetsw2.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 & ZHENGLI, vbInformation, HEADER End Sub6、关闭编辑窗口;7、依次点击菜单栏上的工具---宏-----宏,选AllInternalPasswords,运行,确定两次,等候一两分钟,会出现以下对话框:这是Excel密码对应的原始密码(此密码和之前设置的密码均能打开此文档。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Excel工作表保护密码清除1,打开需要解除保护的EXCEL工作表;2,选择工具---宏----录制新宏---输入名字如:aa;3,停止录制(这样得到一个空宏);4,工具---宏----宏,选aa,点编辑按钮;5,删除窗口中的所有字符(只有几个),替换为下面的内容:(复制吧);6,关闭编辑窗口;7,工具---宏-----宏,选AllInternalPasswords,运行,确定两次,等2分钟,再确定.OK,旧的密码自动提示,工作表也自动解除保护了。
内容如下:========================================================================== ========Public 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 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 & "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 & 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 & 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 & 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 In WorksheetsShTag = ShTag Or w1.ProtectContentsNext w1If Not ShTag And Not WinTag ThenMsgBox MSGNOPWORDS1, vbInformation, HEADER Exit SubEnd IfMsgBox MSGTAKETIME, vbInformation, HEADERIf Not WinTag ThenMsgBox MSGNOPWORDS2, vbInformation, HEADER ElseOn Error Resume NextDo 'dummy do loopFor 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 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 In Worksheets'Attempt clearance with PWord1w1.Unprotect PWord1Next w1On Error GoTo 0ShTag = FalseFor Each w1 In Worksheets'Checks for all clear ShTag triggered to 1 if not. ShTag = ShTag Or w1.ProtectContentsNext w1If ShTag ThenFor Each w1 In WorksheetsWith w1If .ProtectContents ThenOn Error Resume NextDo 'Dummy do loopFor 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 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 In Worksheetsw2.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========================================================================== ====Excel表格密码保护的解除方法表格受密码保护时,我们修改数据Excel弹出“您试图更改的单元格或图表受保护,因而是只读的。