excel工作表密码如何破解
发布时间:2022-11-12 07:37:56
在工作中使用excel工作表的时候,一些重要的文件我们都会给它设置上密码,但时间久了,忘记密码了,该如何才能破解呢?下面随小编一起看看吧。
excel工作表密码的破解步骤
打开excel工作表。
然后在Excel表中找到【视图】。
点开【宏】。
然后选择【录制宏】。
接着会弹出一个窗口,点击【确定】。
在此点开【宏】,点击【停止录制】。
然后再点击【宏】,弹出窗口点击【编辑】。
然后点击【模板1】,并清空右边红框里的代码,如下图。
然后把破解代码复制粘贴进入空白处(破解代码小编将在文章最底部分享给大家)。
10然后在打开【查看宏】,点击执行破解代码。
会弹出一个框,是英文的,看不懂没关系,点击确定,解密需要一段时间。
破解代码:
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
excel工作表密码破解的


猜你喜欢
- 5月17日,随着WPS Office 2013的发布,金山还推出了Linux版WPS Office Alpha10。新版本的Linux界面及
- 在Excel中因为一些重要的数据而不能让他人随意修改,这个时候就需要用到密码进行保护,下面是小编带来的关于如何加密excel文件的教程,希望
- 在使用Excel的时候,我们难免需要将文本里面的内容转换成小写的格式,那么该怎么操作呢?下面小编就为大家介绍一下,一起来看看吧在Excel的
- Byword for mac是一款非常不错的Markdown文本编辑工具,不带有其他的特殊功能。它奉行极简主义理念,没有任何复杂的设置,可以
- Excel是Microsoft为使用Windows和Apple Macintosh操作系统的电脑编写的一款电子表格软件。Excel中有很多实
- 做开发的没有好用的电脑,就像战场上的士兵没有顺手的武器。公司的一台服务器已经换了好几台笔记本了,这不,又有一台笔记本挂了,风扇转的慢,几分钟
- 很多人想要将excel2007表格转换成图片都是使用截图,但截图难免会有缺陷,其实,excel2007是自带照相机功能的。下面让小编为你带来
- win10系统经常更新,这解决了已知的BUG问题,让系统更稳定。但是有的用户在更新过程中会提示更新失败,并提示错误代码0xc0000005,
- 发现自己4G的内存居然使用率只有2G,Y也就是说明明4G的内存却只能使用2G,该部分内存可能被系统自动设置成硬件保留内存了。那么,我们该怎么
- 我们如果将图片保存到本地的话会发现文件夹中的图片有一个排序,有的用户想要调换文件夹中图片的位置,那有没有方法可以操作呢,大家可以尝试下方的操
- 晶格化背景,也就是低多边形背景,在PPT中比较常见,加个晶格化,能有不错的效果。其实,要制作这种背景很容易,花不了多少时间,以下是我总结的3
- Win11用户可以通过wsa来安装想要的安卓应用,包括游戏、软件等等,有时候也会遇到wsa无法启动的问题,这时候要怎么办?其实是因为wsa服
- 为了文件看起来一幕了然,我们可以在文件中插入图片,那么在Excel中怎么插入组合图?下面小编就为大家详细介绍一下,不会的朋友可以跟着教程一起
- Windows 10强制自动更新惹麻烦,自从上个星期win10 10240自动更新后,电脑无法使用第二屏幕,还闪烁个不停,这主要是因为win
- 在excel中,对于一些计算表和工作薄,用户不希望将sheet的某个部分进行修改,通过锁定和保护可以实现工作表的部分或者整个工作薄的保护。下
- 微软警告:若 Win11 KB5012643 补丁导致应用程序崩溃,建议卸载它,下文就为大家带来了详细的介绍,需要的朋友一起看看吧 
- Word是Microsoft公司开发的Office办公组件之一,主要用于文字处理工作。其实Word中的小技巧有非常的多,下面就给大家介绍一下
- WPS中怎么将除法计算的过程以竖排的形式显示出来?我们经常会计算除法,但是直接写出结果怕别人不知道怎么计算出来的,下面我们就来看看wps中显
- 剪贴板是 Mac 端工作者最常用的工具之一,即使不使用任何外设应用,仅依靠系统剪贴板,我们也常常顺手对文本和图片进行复制粘贴。然而,在这种情
- 罗技驱动安装一直初始化怎么办?罗技驱动能够允许用户对自己的罗技设备进行各方面的设置修改,但是有的朋友遇到了在驱动安装时出现了一直在初始化,无