在日常工作中,您是否遇到过这样的情况:您用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 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 Sub
-----------------------------------------------------------------------------------------

复制到横线以上
6、关闭编辑窗口;
7、依次点击菜单栏上的工具—宏-----宏,选AllInternalPasswords,运行,确定两次;
等一会,就会出现以下对话框:这就是Excel密码对应的原始密码(此密码和原先设置的密码都能打开此文档。如果是别人的文档,你又想恢复密码设置,就可以用此密码进行保护,他就能用他设置的密码打开,你可以试试,很有趣的。字母一定要大写):

Excel—“撤销工作表保护密码”的破解并获取原始密码相关推荐

  1. Excel撤销工作表保护方法(Excel无法调节列宽解决办法)

    Excel撤销工作表保护方法 前言 1.Excel工作表保护表现 2.忘记密码如何清除Excel的密码保护 1.第一步:录制宏 2.第二步:结束宏 3.第三步:编辑宏脚本 4.运行结果 前言 在某工作 ...

  2. excel撤销工作表保护默认密码_我的表格我做主:Excel工作表不想被别人改动,设置一个密码保护...

    工作中,一个Excel表格需要多人填充数据时.或者发给同事的表格只允许查看时,不想表格回来时已面目全非. 今天小编教你设置工作表保护密码,不需要再三叮嘱,只允许查看表格数据的整体设置保护,需要多人填充 ...

  3. excel 撤销工作表保护

    方法: 1\打开文件 2\工具---宏----录制新宏---输入名字如:aa 3\停止录制(这样得到一个空宏) 4\工具---宏----宏,选aa,点编辑按钮 5\删除窗口中的所有字符(只有几个),替 ...

  4. excel取消工作表保护

    设置excel文件工作表保护,可以有效保护文件内容,但如果很多文件都设置了工作表保护,密码还不一样的话,可能会导致密码弄混.不记得密码.可是想要编辑excel文件就必须撤销工作表保护才行.网上有很多使 ...

  5. Excel 2013 工作表保护密码破解

    温馨提示: 此方法不适用于 一打开就要输入密码 才能查看的表格 之前整理了下 Excel 2013 的工作表保护密码破解办法 今天无意中又用到了,就分享出来吧 Tips:如果你想彻底加密你的工作表,把 ...

  6. excel 文件工作表保护密码破解

    1.快捷键A1t F11打开vbe编辑器→插入菜单 2.选择"插入"模块 3.把下面的代码复制过去→然后把光标点到代码里→F5运行一下→工作表保护就破解了. Sub 破解工作表密码 ...

  7. Excel 撤消工作表保护密码

    Excel表格密码保护的解除方法 表格受密码保护时,我们修改数据Excel弹出"您试图更改的单元格或图表受保护,因而是只读的.若要修改受保护单元格或图表,请先使用'撤消工作表保护'命令(在' ...

  8. excel取消工作表保护,获取原始密码

    您试图更改的单元格或图表位于受保护的工作表中.若要进行更改,请取消工作表保护.您可能需要输入密码. 网上找的解决办法,在excel2016中试过后,有效. 1.打开需要破解保护密码的Excel文件: ...

  9. 如何把密码写入代码,让VBA自动撤销工作表保护 / 工作簿保护(使用VBA代码 保护工作表 / 工作簿 和取消保护工作表 / 工作簿)

    对工作表的操作--worksheet    其中的"123"  是密码  下面同理 Sub test_worksheet_key()ActiveSheet.Protect (&qu ...

  10. excel文件工作表保护如何取消

    excel文件设置了工作表保护,想要编辑excel文件就需要对excel文件的工作表保护进行撤销,但是如果想要撤销的前提是输入正确的密码,因为在设置工作表保护的时候设置了密码,所以想要撤销保护也需要输 ...

最新文章

  1. leetcode--罗马数字转整数--python
  2. c语言不能写入文件,求大神看看为什么不能将数据写入文件
  3. pythongetattribute_对Github上Python开源项目进行分析时遇到的一个AttributeError的解释及其解决方法。...
  4. android点九,android关于点九(.9)图片
  5. java年利润编程题_[编程入门]利润计算-题解(Java代码)
  6. JavaScript 修改Cookie
  7. iOS 完全复制UIView
  8. Jmeter发送get请求
  9. scrapy下载图片第一波
  10. 关于python的闭包与装饰器的实验
  11. 2060. 奶牛选美
  12. springcloud之feign远程调用
  13. 计算机学生选课系统毕业论文,学生选课管理系统论文
  14. 超标量处理器设计 姚永斌 第2章 Cache 摘录
  15. ROS 安装教程Ubuntu16.04(2022年最新)
  16. 微信小程序中使用emoji表情
  17. Android10手机OTG按钮,我又来了-荣耀10青春版手机OTG功能你会用吗?
  18. oracle gbk 转码,oracle编码格式从utf-8转换为GBK
  19. k8s:worke节点启动后,node处于NotReady状态
  20. yield 函数的理解

热门文章

  1. android 罗盘陀螺仪,电子罗盘有什么用,安卓智能手机的感应器的问题! 电子罗盘与陀螺仪有......
  2. 水经注万能地图下载器下载的瓦片如何应用到web端的cesium中
  3. snmp trap 如何在浏览器中_SNMP TRAP功能
  4. Python之pygame安装教程
  5. access里面的表达式运用_Access表达式
  6. 图书信息管理系统需求分析
  7. 【Reference Reading】一种基于双硼/Gd剂的治疗诊断学方法以提高硼中子捕获治疗肺癌的疗效
  8. 谷歌chrome 71 flash 添加问题的解决方案(chrome禁用添加允许flash的选项)
  9. AR人体姿态识别,实现无边界的人机交互
  10. 统计分析——回归分析