excel表格保护密码忘了怎么办
发布时间:2023-12-18 20:32:45
在使用Excel的时候,都会讲excel给设置了密码,以防他人篡改或误删数据。但时间长了,密码却忘记了,这是该如何是好。下面让小编为你带来excel表格保护密码忘了的解决方法。
excel密码破解步骤如下:
打开受密码保护的工作表
工具—宏—-录制新宏—输入名字如:hh
停止录制(这样得到一个空宏)
工具—宏—-宏,选hh,点编辑按钮
删除窗口中的所有字符,替换为下面的内容:
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
关闭编辑窗口 ,工具—宏—–运行,等1分钟,再确定.OK,没有密码了
关于excel密码破解的相关文章推荐:
1.Excel文件密码破解汇总
2.如何破解excel密码的方法
3.excel2013密码破解的方法


猜你喜欢
- 在Excel 2010工作簿中,工作表的默认名称为“Sheet+数字”,如Sheet1、Sheet2等,用户可以根据实际工作需要对工作表名称
- 关于求和,大家都已经非常的熟悉了,大部分情况下是用“命令”或Sum函数求和,其实还有很多种求和的方式,如大家比较熟悉的Sumif、Sumif
- 众所周知,我们的视频格式一般分为RM/RMVB格式,这种格式也是最常见的。现在大部分视频资源都是以RM/RMVB格式存在的。但是,近日有用户
- PS如何制作简洁的相机图标?最近有小伙伴问我使用ps怎样才能制作出简洁的相机图标,今天的教程小编就给大家带来ps制作简洁相机图标的具体方法步
- IE浏览器是微软自带的浏览器,很多用户都会使用它来查询资料文件等等。但是如果IE浏览器出现脱机状态该如何解除呢?这是InternetExpl
- 存储空间的新功能将利用一个物理存储设施组成数据池,一旦用户成功地创建存储空间,它就能够像操作人员正常使用硬盘一样使用。这个功能的另一个好处是
- WPS图片怎么改变形状?1.双击计算机桌面上Wps演示图标上的鼠标左键,将其打开进行操作。如图所示;2.在打开的Wps文档窗口中插入图片,复
- 许多人买了MacBook之后还要装Windows系统。究其原因,毕竟用了那么多年的Windows,什么功能用什么软件早已经门儿清了,但mac
- Win7系统的任务栏有一个缩略图功能,当鼠标指向某一个任务的时候就会显示一个预览窗口,但是有用户反馈说自己的Win7系统并没有这个功能,这是
- 在制作PPT时,经常需要将数据可视化,来将复杂信息数据清晰表述出来。通过可视化信息,可以更有效地合成和保留信息内容,增强对信息的理解。数据可
- Word是地球上最常用的计算机程序之一。帮助您撰写文本是计算机性能出色的事情之一,但这并不能使文本编写工作变得更加轻松,也不意味着使用Wor
- 电脑在使用的过程中,系统会产生很多垃圾,时间长了,会引起系统卡顿。那系统垃圾有哪些?下面给大家罗列一下。一、临时文件 二、系统缓存
- 使用win10系统,蓝屏是经常有的事,因为win10本身并没有像win7那样稳定。如果使用中遇到蓝屏终止代码bad system confi
- 在我们使用win7系统安装软件的时候经常会遇到捆绑安装的软件,而这些流氓软件每次删除后都会自动回复,那么碰到这个问题应该怎么办呢?下面就和小
- 在面对众多的视频软件时用户一般会根据使用习惯来安装软件,例如快播软件就受到了很多用户的欢迎和喜欢,因为这款视频播放器可以让用户播放各种格式的
- 腾讯会议是款当下很受欢迎的线上会议软件,其拥有高清且稳定的画质,可以为用户带来最佳的线上会议体验。近期有用户在使用腾讯会议进行线上会议时,需
- 很多朋友不太清楚Mac怎么安装IE浏览器?下面小编给大家带来苹果MAC安装IE浏览器教程,需要的朋友可以参考下有一些比较旧的网站只支持 IE
- 最近Epic这个游戏平台可以说是非常的火,很多小伙伴都在Epic上领取了假日特惠的免费游戏,但是在使用Epic的时候却提示404,那么遇到这
- 订阅 Apple Music 后打开“同步资料库”功能,这样就可以在不同设备上访问你的音乐资料库,以及在任一设备上从 Apple Music
- 咱们在 操纵Excel表格 停止 一样平常办公时, 常常 需求 建造 林林总总的表格, 特别是人力 资本的 伴侣,也 常常会 输出员工的 联