如何解密excel的方法
发布时间:2023-09-07 05:28:59
在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啦!


猜你喜欢
- 虽然说新买的电脑都是会自带官方的系统,但在使用的过程中难免会因为不恰当的操作或者系统问题而导致电脑无法正常的使用,一般这个时候我们就要需要去
- 115网盘是广东五科技有限公司日推出的网络数据在线存储服务,因为其好用程度,受到了广大网民的欢迎。其欢迎程度几乎能够与百度网盘媲美。好多小伙
- 有用户反映一直无法登陆12306网站,这是怎么回事呢?12306网站的验证码是最出名的了,但是也经常会出现无法登陆网站的情况,如何解决这个问
- 运行一段时间以后,会发现电脑开始启动的时候越来越长,主要问题在于你的系统越来越臃肿,系统垃圾在侵蚀你的电脑,下面为大家介绍喜下具体的清理方法
- win11win键被锁怎么办?我们在使用电脑的时候通常会用到快捷键来操作,使用快捷键可以快速打开我们想要打开的界面,从而提高我们的操作速度,
- win10邮箱存在于win10自带的系统里,很多时候默认的设置会给用户带来许多的麻烦,就比如使用时发现无法访问此账户,那么这个问题该怎么解决
- 工作时有时会需要二张格式完全一样的表格,大家可能首先会想到,这简单,把整张表格全选中,复制、粘贴就可以得到二张完全一样的工作表了。其实除了这
- 最近小编有朋友尝试最近重装系统,虽然顺利的把系统安上去了。但是每次开机都要会提示有DHCP,要等很久才能开机。于是小编过去给他看了看,很快就
- Excel怎么全选数据?excel表格是常用的强大的办公软件,通过快捷的操作指令,可以方便用户选取需要的数据,那怎么全选excel表格的全部
- 今天小编为大家带来了Win7电脑中利用命令提示符拷贝硬盘数据图文教程,感兴趣的朋友们可以跟着小编去下文了解一下哦 1.首先,在自己
- Excel文件如何转换成txt文件呢?我经常用另存为的小技巧来实现这个目标,我们一起来看看这个小技巧的具体操作步骤吧!第一步,建立一个需要转
- Excel2016怎么开启宏? 1、打开Excel2016,点击左上角的文件,之后点击“选项”。如下图 2、在弹出的“Excel选
- Win10系统可以说是最常用的系统之一,在使用电脑的过程中经常下载一些软件进行使用,但这些软件删除后会有一些注册表信息残留在电脑中,遇到这种
- 当我们的电脑出现一些系统故障时,可以试试在开机时按f12来进行系统的修复。但是还有不少小伙伴不清楚具体的修复操作步骤,今天小编要给大家介绍的
- Win11系统任务栏怎么添加小部件图标?在最新的Win11系统中,微软新增了一项名为Widgets的功能。这个功能是Win10系统中可用的“
- 全屏播放图片的过程中,如果我们想要控制幻灯片放映,可以随时用鼠标右键单击画面,这时我们会看到一个菜单,这个菜单中包含有控制选项其实,让Win
- 近日有消息显示,下一版Win10预览版Build将会不久推送。俄罗斯爆料者Wzor声称微软已经在内部开始测试Windows build 10
- 方法一1、用WORD根据文章的章节自动生成目录--1.在[格式]中选[样式与格式]--2.出现右边的一条“样式格式”栏,这里面主要就是用到标
- Win7系统桌面图标上的小箭头怎么去掉呢?系统软件图标上的小箭头表示该图标是快捷方式,但是也影响了整体的美观,如何去除呢?下面来看看怎么操作
- 现如今全国盛行共享单车,并且已经出现在很多城市中,在共享单车中就有摩拜单车,很多小伙伴充值之后投入使用,然而余额是不能购买月卡的,只能用于骑