wps撤销工作表保护密码原始密码

WPS论坛表格好帖推荐
Excel密码保护的解除方法与解除原理
一键分享:
  Excel弹出“您试图更改的单元格或图表受保护,因而是只读的。若要修改受保护单元格或图表,请先使用‘撤消工作表保护’命令(在‘审阅’选项卡的‘更改’组中)来取消保护。可能会提示您输入密码。”窗口,如图1。  出现这种情况,应该怎么解决呢?经过研究,找到了两种破解Excel工作表保护码的方法。  一、VBA宏代码破解法:  第一步:打开该文件,先解除默认的“宏禁用”状态,方法是点击工具栏下的“选项”状态按钮,打开“Microsoft Office安全选项”窗口,选择其中的“启用此内容”,“确定”退出(图2);  再切换到“视图”选项卡,点击“宏”→“录制宏”,出现“录制新宏”窗口,在“宏名”定义一个名称为:PassWordBreaker(图3),点击“确定”退出;  第二步:再点击“宏”→“查看宏”,选择“宏名”下的“PasswordBreaker”并点击“编辑”,打开“Microsoft Visual Basic”编辑器,用如下内容替换右侧窗口中的所有代码:  Sub PasswordBreaker()  Dim i As Integer, j As Integer, k As Integer  Dim l As Integer, m As Integer, n As Integer  Dim i1 As Integer, i2 As Integer, i3 As Integer  Dim i4 As Integer, i5 As Integer, i6 As Integer  On Error Resume Next  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  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 Then  MsgBox "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).Select  Range("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 Sub  End If  Next: Next: Next: Next: Next: Next  Next: Next: Next: Next: Next: Next  End Sub  第三步:再点击“宏”→“查看宏”,选择“宏名”下的“PasswordBreaker”并点击“执行”,密码就现形了(图4)。  第四步:切换“审阅”选项卡,点击“撤消工作表保护”,然后输入密码即可解除锁定。  二、软件破解法  有许多专门为破解Excel各种密码而制作的软件,Excel Key与Advanced Office Password Recovery就是其中的佼佼者。它们的使用方法简单且破解速度极快。  1. Excel Key  下载安装完后运行软件,点击工具栏“Recovery”按钮,找到要破解的文件,软件马上就可以解出密码了(图5)。  2. Advanced Office Password Recovery  下载安装完后运行软件,点击工具栏“Open File”按钮,打开要破解的Excel文件,马上就可以看到解出的密码了(图6)。  可以看出,用以上方法读出的密码完全不同,但它们确实均可以解除该工作表的密码保护,这实在是个有趣的问题。  在网上查找了许久,终于找到比较圆满的解释答案:  当Excel工作表采用密码保护时,就会生成一个16位(双字节)长hash值。当输入密码进行验证时,真正进行比较的就是这个hash值。事实上,有很多不同的密码都可以生成同样的hash值。  大家可以试试:  当你用“test”(不含双引号)作为Excel工作表保护密码,你同样可以用“zzyw”(同样不含双引号)这个密码进行解锁。怎么样,神奇吧?酒罢歌梁祝,情多付婵娟。
WPS2017 电子表格/Excel文件保护密码忘记了?
WPS2017 电子表格/Excel文件保护密码忘记了?
废话不说,直入正题。
妹妹有一个考勤表格的保护密码忘记了,要发上个月工资了,着急坏了,求助万能的老哥!
隐约记得密码有10来位,不是数字,在着急用的前提下使用工具暴力破解密码完全来不及。
想了一下,Excel文件的保密密码应该是使用弱加密算法直接保存在文件中的,想了两个办法:
1、使用16进制编辑器,查接查看Excel文件本身,看看能不能找到登记密码的位置
2、使用VBA解码
出于程序员的本能,决定先试用VBA的方法。
WPS2017个人版都没VBA功能,首先需要安装VBA支持,我在如下位置下载了VBA安装包:
下载完成后,查了一毒,表示安全。开始安装,安装步骤不再赘述。
安装完成后,用WPS表格打开待解密的Excel文件,通过菜单“开发工具 - 录制新宏”录制一个新宏,直接关闭。
通过菜单“开发工具-宏”打开宏管理器,编辑刚刚录制的新宏,删除全部代码,输入下文中的代码:
Option Explicit
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 & "$$" & 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 Boolean
Application.ScreenUpdating = False
With ActiveWorkbook
WinTag = .ProtectStructure Or .ProtectWindows
ShTag = False
For Each w1 In Worksheets
ShTag = ShTag Or w1.ProtectContents
If Not ShTag And Not WinTag Then
MsgBox MSGNOPWORDS1, vbInformation, HEADER
MsgBox MSGTAKETIME, vbInformation, HEADER
If Not WinTag Then
MsgBox MSGNOPWORDS2, vbInformation, HEADER
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
Next: Next: Next: Next: Next: Next
Next: Next: Next: Next: Next: Next
Loop Until True
On Error GoTo 0
If WinTag And Not ShTag Then
MsgBox MSGONLYONE, vbInformation, HEADER
On Error Resume Next
For Each w1 In Worksheets
'Attempt clearance with PWord1
w1.Unprotect PWord1
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
If ShTag Then
For Each w1 In Worksheets
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
Exit Do 'Bypass all for...nexts
Next: Next: Next: Next: Next: Next
Next: Next: Next: Next: Next: Next
Loop Until True
On Error GoTo 0
MsgBox ALLCLEAR & AUTHORS & VERSION & REPBACK, vbInformation, HEADER
End Sub关闭宏编辑窗口,通过菜单“开发工具-宏”打开宏管理器并运行AllInternalPasswords
此时会弹出对话框,无视并点确定
弹出第二个对话框,继续无视并点确定
神奇的事情发生了,密码出现在第三个对话框中,拿出纸笔抄录一下:
密码成功能回,希望能撤销密码保护的朋友,请自行百度。
没有更多推荐了,
加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!EXCEL忘记密码怎么办?EXCEL工作表怎么清除密码
时间: 14:15:29
来源:下载吧
编辑:yangxiaorong
  EXCEL是最常用的办公制表软件,有时候制作的工作表想为了保护数据,设置了表格保护,但是如果输入密码出错或者密码太久了记不清怎么办?只能用另外的方法来解决EXCEL密码忘记的问题了。  1、首先打开EXCEL,选择视图,宏,录制新宏,新建一个宏,可以随便取个名字。  2、先生成一个空的宏  3、编辑这个宏,选中刚新建的宏后点击编辑按钮  4、删除窗口所有字符,把下面的内容粘贴进入。一个字母、标点符号都不能少不能错。  Option Explicit  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 & &$$& & 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 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, _  &$$&, 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  5、关闭掉编辑窗口  6、在宏里选中AllInternalPasswords这个编辑好的宏,执行,并且确定数次,就OK了。
喜欢这文章可以分享给您的朋友哦
永远不要低估电子表格的力量。Visual Basic for Applications(VBA)是Vis...
自从有了计算机之后,数据可视化变得越来越容易。虽然Excel已经是数字处...
今天微软更新了iOS版的Word、Excel以及PowerPoint,更新后的版本号均为1...
今天微软发布了Office 2016 for Mac的全新预览版,如果你有兴趣下载这款...
Win10正式版刚刚推出不久,系统有着不少的小BUG。而Excel是Win10系统中一...
今天面向Office Insider成员发布的Office 2016版本更新中,Version号已经...
永远不要低估电子表格的力量。Visual Basic for Applications(VBA)是Vis...
微软技术大会 Ignite 今天在北京召开,展示了一系列技术进展,包括“牛津...
周末也是微软推出Excel 1.0三十周年的日子,这款无所不在的电子表格软件...
自从有了计算机之后,数据可视化变得越来越容易。虽然Excel已经是数字处...
今天微软更新了iOS版的Word、Excel以及PowerPoint,更新后的版本号均为1...
今天微软发布了Office 2016 for Mac的全新预览版,如果你有兴趣下载这款...
在生活和工作中你可能需要或者经常需要将“表格转成Jpg格式图片”,有个...
我们在工作用最想看到最清晰的数据,而插入柱形图,可以更清晰的显示出数...
Win10正式版刚刚推出不久,系统有着不少的小BUG。而Excel是Win10系统中一...Excel被保护的工作表没有密码如何撤销? - 知乎有问题,上知乎。知乎作为中文互联网最大的知识分享平台,以「知识连接一切」为愿景,致力于构建一个人人都可以便捷接入的知识分享网络,让人们便捷地与世界分享知识、经验和见解,发现更大的世界。1被浏览<strong class="NumberBoard-itemValue" title="分享邀请回答11 条评论分享收藏感谢收起写回答

我要回帖

更多关于 撤销工作表保护原密码 的文章

 

随机推荐