在使用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密码破解的方法
猜你喜欢
- 注意:和PDF转word一样,如果PDF文件是加密的,是不能够转换的;对于一些完全没有excel特征的表格请不要尝试使用下面的软件进行转换,
- “粘贴链接”功能可以在Word2010原始文档和目标文档之间建立一个动态链接,当原始文档的内容更新后,目标文档中的内容会同步更新。在Word
- 下面的WAPP是事先定义的word文档工程变量。以下代码为通过VBA代码修改Word段落的缩进、段落间距、行距、分页等。//段落格式设定WA
- excel中更换两行的方法Excel是当今社会最流行用的办公软件之一,Excel可以用于数据的整理、分析、对比。可以更直观的看到数据的变化情
- 有时在编辑整理文档文稿时不免要进行频繁的复制粘贴操作,不知不觉的有的段落已经复制粘贴了很多遍,出现这个问题,就要校对解决。如果是短文档,人工
- 微软公司还对win10当前最新的操作系统进行了不断升级和改进。所以根据小编最近了解到的消息,对于这次KB4532693补丁更新了什么,除了以
- 众所周知,Excel2013是自带了排序功能的,不管你需要排序的是字母、数字还是文本,它都有它自己的一套排序方法。但如果很不巧的,我们的需要
- HomeKit 可将你家中各种 Apple 支持的设备 (包括智能灯泡、安全摄像机和恒温器) 连接到名为 Home 的 iOS 控制中心应用
- Excel中表格内的斜线具体该如何画出呢?下面是小编带来的关于excel表格里面画斜线方法,希望阅读过后对你有所启发!excel表格里面画斜
- 很多人从网上下载的pdf格式的文件在电脑上是打不开的,今天,小编就教大家如何解决问题的方法!。这时候我们需要上网去下载Adobe reade
- 在数据展示过程中,我们会经常用到Excel内置的一些图表,比如说直线图、柱状图、饼图等。在展示百分比占比的时候很多同学应该都喜欢用百分比来展
- 在Excel2003中经常需要把单元格给合并了,或许有些初学者对于合并单元格也很陌生。下面是小编整理的2003excel合并单元格的方法以供
- 我只想打印其中的一行,或者从第m行到第n行的数据,这如何实现呢?示例数据工作表、打印样式和要打印的表格模板工作表分别如下、和所示。将“数据”
- 这篇文章将教你如何在微软Excel程序中用柱状图来直观地表现数据。步骤部分 1添加数据打开Microsoft Excel程序。它是
- 近来有小伙伴反应win10镜像文件该怎么下载,因为市面上镜像文件多得是,要找正规文件下载,这该怎么办?今日小编带来了一些下载镜像的链接,详细
- 用户在使用Word2003编辑Word文档的过程中,有时会遇到“隐含模块中的编译错误:UserAddWord”的错误提示,可以按照如下方法加
- Word文档中既有中文也有英文进行中英文混排的情况下,设置字体时非常麻烦因为中文的字体有时并不适合其中的英文,但如果全部分开进行设置工作量又
- excel2007/2010怎么设置不同文档窗口分离显示?有时候想打开多个excel表格查看或编辑内容,但是只能在一个窗口里面看,需要在任务
- 对于老师来说在统计成绩的时候excel是不可缺少的,但是使用excel统计成绩很多时候会遇见常见的问题,比如说:如何统计不同分数段人数、如何
- 简介:字符间距是指字与字之间的距离,类似于列宽。word文档中可以调整字符间距。步骤:选中文本2.点击【开始】3.点击段落组中点击中文版式按