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


猜你喜欢
- 咱们在 利用WPS表格的 时分, 必定会 碰到 工夫日期 计较的 成绩。你还在手动一天一天的数吗? 假如只是几天的话,还 能够 了解, 过久
- 相信大家都知道电脑的显存其实也就是显卡的内存。显存对于显卡的显示性能非常重要,那么在Win10专业版中如何查看电脑的显存呢?下面就给大家介绍
- 我们需要考虑一下有必要升级到WIN8吗.以下从十个方面介绍很多Windows 8的粉丝有疑虑,安装或者升级到Windows 8之前需要注意哪
- 很多小伙伴都已经用上了win11系统了,在使用win11系统时不是很熟悉,现在win11系统也是属于预览版,有些小伙伴们不知道win11怎么
- 第一部分:excel 逻辑函数使用说明excel 逻辑函数都包括些什么呢,什么是逻辑函数呢?excel 逻辑函数就是用来判断真假值,或者进行
- 据国外媒体报道,很多人都担心自己的智能手机电池会耗尽,尽管手机制造商不断声称,自己研制的手机电池寿命会有所提高,但是人们往往觉得手机总是处于
- excel宏或许对于新手来说显得高大上,但是如果使用熟练了就觉得缺他不可了,并且excel宏功能十分强大,但因为存在安全风险而被默认禁用,下
- 腾讯文档是一款优秀的办公软件,有非常的小伙伴都在使用,但是有些小伙伴说自己在导入本地文件的时候腾讯文档会出现乱码的情况,那么要如何在遇到这种
- 一些Windows 10系统会在安装Creators Update时触发系统错误,并表示市面上流行的第三方开始菜单软件可能导致黑屏,已经发现
- 微软最新Win11 KB5007215补丁发布了!11月10日,微软公司发布了Win11 11月累计更新补丁KB5007215,此次更新的版
- ThinkBook 14+是联想旗下一款配置选择很多的笔记本,该笔记本不仅外部接口丰富,数量充足,而且同类产品中,性能释放较强,那么这样一台
- 相信大家经常使用Excel表格筛选功能作为汇总方法之一,今天跟大家分享下如何利用筛选快速统一不规范数据。第一,打开一个需要筛选的不规范表格,
- 大家在日常使用Excel的过程中有非常多的填充和分列的场景,这里我们分享两个使用比较多的场景和处理方法,希望给大家在工作中节省一些时间。1、
- 在制作PPT的过程中我们经常会遇到各种各样的问题,不过这些问题在PPT中都可以找到对应的工具解决,同一个问题我们可以通过不同的设置进行解决,
- 为什么软件默认安装位置是在C盘?首先,需要明确一点,如果操作系统被安装在D盘,就会发现少有软件会自动识别系统路径并出现D盘的默认安装位置,然
- Excel中的斜线该如何画并且如何在内输入两行字呢?接下来是小编为大家带来的excel中画斜线并输入两行字的教程,供大家参考。excel中画
- 通配符*和?的区别是“*”可以用来代替零个、单个或多个字符,而“?”仅可以使用代替一个字符;“*”表示匹配的数量不受限制,而“?”的匹配字符
- 如今移动设备除了娱乐一大作用外,阅读也是不可忽视的主要用途。无论是查看还是编辑,WPS移动版都以与桌面版Office相似度最高而著称。不过,
- 现在重新系统的方式有很多种,如光盘装系统和u盘装系统,现在网上多数都是通过U盘的安装方法来重装,但也有的网友了解到了光盘重装的方法,那么光盘
- 欢迎观看 Pixelmator Pro 教程,小编带大家学习 Pixelmator Pro 的基本工具和使用技巧,了解如何在 Pixelma