当前位置:首页 > 电脑教程 > 软件教程 > 正文内容

Excel密码怎么破解?有密码怎么取消保护?


  Excel文件设了密码却忘了咋整?别慌,这儿有两种破解法子呢,赶紧来看看!



  方法一,要是咱们有密码,能直接在打开的excel里找“工具”――》“保护”――》“撤消工作簿保护”,在弹出窗口输密码就行啦。



  告诉你破解密码保护的excel文件



  告诉你破解密码保护的excel文件



  方法二,要是没密码,咱们能靠“宏模块”来破解,下面一起瞧瞧具体步骤哈。



  1、先打开要处理的excel文件,然后按“ALT”+“F11” ,如下图所示。



  告诉你破解密码保护的excel文件



  2、接着点击菜单上的“插入”――“模块”,如图所示。



  告诉你破解密码保护的excel文件



  告诉你破解密码保护的excel文件



  3、把下面的代码复制粘贴到空白区域;



  告诉你破解密码保护的excel文件



  代码如下



  复制代码



  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 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 & "


&\#x22; &\#x26; DBLSPACE &\#x26; _&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;&\#x22;Note it down for potential future use in other workbooks by &\#x22; &\#x26; _&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;&\#x22;the same person who set this password.&\#x22; &\#x26; DBLSPACE &\#x26; _&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;&\#x22;Now to check and clear other passwords.&\#x22; &\#x26; AUTHORS &\#x26; VERSION&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;Const MSGPWORDFOUND2 As String=&\#x22;You had a Worksheet &\#x22; &\#x26; _&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;&\#x22;password set.&\#x22; &\#x26; DBLSPACE &\#x26; &\#x22;The password found was: &\#x22; &\#x26; _&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;DBLSPACE &\#x26; &\#x22;
" & 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 Boolean



  Application.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, _



  "


&\#x22;, PWord1), vbInformation, HEADER&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;Exit Do &\#x27;Bypass all for...nexts&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;End If&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;End With&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;Next: Next: Next: Next: Next: Next&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;Next: Next: Next: Next: Next: Next&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;Loop Until True&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;On Error GoTo 0&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;End If&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;If WinTag And Not ShTag Then&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;MsgBox MSGONLYONE, vbInformation, HEADER&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;Exit Sub&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;End If&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;On Error Resume Next&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;For Each w1 In Worksheets&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;&\#x27;Attempt clearance with PWord1&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;w1.Unprotect PWord1&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;Next w1&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;On Error GoTo 0&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;ShTag=False&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;For Each w1 In Worksheets&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;&\#x27;Checks for all clear ShTag triggered to 1 if not.&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;ShTag=ShTag Or w1.ProtectContents&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;Next w1&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;If ShTag Then&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;For Each w1 In Worksheets&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;With w1&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;If .ProtectContents Then&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;On Error Resume Next&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;Do &\#x27;Dummy do loop&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;For i=65 To 66: For j=65 To 66: For k=65 To 66&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;For l=65 To 66: For m=65 To 66: For i1=65 To 66&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;For i2=65 To 66: For i3=65 To 66: For i4=65 To 66&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;For i5=65 To 66: For i6=65 To 66: For n=32 To 126&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;.Unprotect Chr(i) &\#x26; Chr(j) &\#x26; Chr(k) &\#x26; _&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;Chr(l) &\#x26; Chr(m) &\#x26; Chr(i1) &\#x26; Chr(i2) &\#x26; Chr(i3) &\#x26; _&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;Chr(i4) &\#x26; Chr(i5) &\#x26; Chr(i6) &\#x26; Chr(n)&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;If Not .ProtectContents Then&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;PWord1=Chr(i) &\#x26; Chr(j) &\#x26; Chr(k) &\#x26; Chr(l) &\#x26; _&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;Chr(m) &\#x26; Chr(i1) &\#x26; Chr(i2) &\#x26; Chr(i3) &\#x26; _&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;Chr(i4) &\#x26; Chr(i5) &\#x26; Chr(i6) &\#x26; Chr(n)&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;MsgBox Application.Substitute(MSGPWORDFOUND2, _&\#x3C;/p&\#x3E; &\#x3010;&\#x6539;&\#x5199;&\#x5F00;&\#x59CB;&\#x3011; &\#x3C;p&\#x3E;&\#x3000;&\#x3000;&\#x22;
", 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 Sub



  4、确定没问题后,按“F5”运行宏模块进行密码破解,先点击确定,之后就能看到图中红框处的密码数字啦



  告诉你破解密码保护的excel文件



  告诉你破解密码保护的excel文件



  5、完成之后再试着编辑excel,就不会有任何问题咯,你也赶紧去试试吧!


相关文章

超级眼内网版和外网版区别,不同网段监控设置教程

超级眼内网版和外网版区别,不同网段监控设置教程

担心员工跳槽时带走公司机密?这款监控软件能帮你解决烦恼!超级眼安装步骤详解1、在本站解压文件后,会得到员工端和管理端两个部分。2、这里我们选择管理端进行安装操作。3、你可以根据自己的需求选择自定义安装...

2345加速浏览器xp版如何设置主页,缓存怎么清理

2345加速浏览器xp版如何设置主页,缓存怎么清理

还在为XP系统找不到合适的浏览器发愁吗?今天给大家推荐这款2345加速浏览器xp版,说不定能解决你的上网难题呢。卸载方法教程要是想卸载这个浏览器,方法其实不少。第一种呢,点击开始菜单,接着打开控制面板...

悟空浏览器邀请码怎么填,自动阅读模式如何开启

悟空浏览器邀请码怎么填,自动阅读模式如何开启

手机浏览器哪款好用又安全?悟空浏览器官方正版必须拥有姓名!作为超流行的移动端浏览器,它不仅功能丰富、体验感好,还特别注重安全和隐私保护,用起来超放心。而且浏览速度快到飞起,多标签页、无痕浏览、广告拦截...

ensp模拟器最新版下载,设备添加连接方法

ensp模拟器最新版下载,设备添加连接方法

想学习网络技术却没有真实设备?别愁!华为ensp模拟器来帮你!这可是华为官方推出的超实用图形化网络仿真工具,让你轻松开展网络实验!华为ensp模拟器安装教程1. 下载文件后解压,双击“eNSP_Set...

怎么删除word中的空白页 word最后一页删不掉怎么办?

怎么删除word中的空白页 word最后一页删不掉怎么办?

在使用word的过程中,有时出现空白页就可能会给大家带来一些困扰。到底怎么样才能把这些空白页删除,又应该如何解决最后也删不掉的问题呢?要想删除普通的空白页,那就需要将光标直接放在空白页,然后按【Del...

Excel怎么查找姓张的人?通配符用法教程

Excel怎么查找姓张的人?通配符用法教程

还在为Excel里找特定内容发愁吗?教你用通配符秒搜姓张的人!1 你看我有这样一张表,现在要把“姓张”的人全部查出来。2 先选中要查找的单元格,接着按"ctrl+F"快捷键3 然后在弹出的“查找与替换...