如何破译excel密码的方法
发布时间:2023-09-19 07:04:34
在Excel中录入过多的重要数据是人们的习惯,所以一般情况下都是进行密码保护的,但过了段时间后很容易把密码忘记了,这个时候就需要破译Excel的密码,下面是由小编分享的如何破译excel密码的方法,希望对你有用。
如何破译excel密码的方法:
破译密码步骤1:打开您需要破解的Excel文件,如图所示:
破译密码步骤2:依次点击菜单栏上的工具—宏—-录制新宏;
破译密码步骤3:输入宏名字(PS:打击积极性啊!)如:易尔拓,然后停止录制(这样得到一个空宏,为后面添加vb代码做准备);
破译密码步骤4:依次点击菜单栏上的工具—宏—-宏,选易尔拓,点编辑按钮;
破译密码步骤5:删除窗口中的所有字符,替换为下面的内容;
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
破译密码步骤6:依次点击菜单栏上的工具—宏—–宏,选AllInternalPasswords,执行,确定两次;
破译密码步骤7:耐心等一会,再点击两次确定,就ok啦!


猜你喜欢
- 在word文档中每一行开头处,分别输入三个或三个以上的下列符号:~~~、###、***、___、---、===,然后按下“Enter”键,就
- 通过修改注册表改变某些设置,是Win10中经常操作的,比如解锁Win10新版时钟应用。每次修改注册表前,都会建议备份注册表以便出现问题后可以
- 咱们在 操纵WPS表格和Excel表格 停止 一样平常办公时 常常 需求 操纵图表来为 咱们 展示数据,图表 能够 明晰地 展示数据的 颠簸
- 想要实现U盘启动,但是在U盘装系统时可能会遇到没有USB启动选项,那么应该如何解决没有USB启动选项实现U盘启动的方法步骤。接下来小编就为大
- 一、准备和资源需求 1.U盘,内置WinPE 启动 . 2.Windows Server 2003 操作系统的 iso 文件。 3.Wind
- Windows 10 Redstone(红石)昨天被曝首版已经编译完成,Build版本号为11082。不同于Threshhold2(TH2)
- 很多小伙伴在打开资源管理器的时候,发现cpu占用特别的高,这个是怎么一回事呢,cpu过高不仅会导致电脑的运行速度变慢,还会加速硬件的使用年限
- iOS 14 中的新应用程序库是一个简单的想法,现在,应用程序库将另一个屏幕添加到您的列表中,但它非常有用。以下是它如何成为您最常用的 iO
- 今日凌晨微软win10发布会已经结束啦,微软做系统已经30年了,我们一起来回顾一下这30年Windows1.0到Win10是如何发展演变的,
- Xmind2022Mac是一款非常便捷的制作思维导图的软件,制作思维导图可以帮助用户更高效的进行学习,在Xmind中如何创建组织结构图呢?下
- 金山办公软件于5月16—17日在WPS官方微博举行#WPS 2013线上发布会#,同时在Windows、Android、iOS、Linux四
- 如何使用Microsoft Word的边框和底纹对话框?若要完全显示Word的边框,请调用“边框和底纹”对话框:单击主页选项卡。在“段落”组
- UGet出现打不开怎么办?UGet是一款非常好用的学习软件,有些用户在使用这款软件的时候,出现了打不开的情况,我们该怎么解决这个问题呢,下面
- 操作方法①首先输入问题,然后单击菜单栏--开发工具--插入--ActiveX控件--复选框。 ②点击复选框之后,在
- Win11是微软新一代操作系统,相信不少朋友近期都升级到了Win11系统,有些人在电脑开机的时候出现黑屏进不去系统的情况,这是由于系统本身出
- win10怎么玩幻想神域?在windows 10系统中打开 幻想神域 就弹出了 CP rotect 警告 的窗口,提示:启动错误,请以管理员
- 有时浏览器会扫描出漏洞,因此我们需要安装补丁,但是安装补丁时出现“安装程序错误,您没有许可来更新windows”是怎么回事呢?为什么安装补丁
- 电脑蓝屏,又叫蓝屏死机,是微软的 Windows 系列操作系统在无法从一个系统错误中恢复过来时,为保护电脑数据文件不被破坏而强制显示的屏幕图
- Win10如何查看硬盘容量?近期有部分用户想要查看电脑硬盘容量,从而知道电脑内存的使用情况。那么我们应该如何查看呢?如果你也有这样的需求,那
- WPS表格是一款新的制作表格的软件,和以前的EXCEL差不多,只不过功能更完备和丰富。用WPS表格软件制作表格方便,快捷,简单。下面小编给大