【转载】如何破解受保护的excel密码

【工具】

1、电脑一台(安装有Microsoft Excel)

2、受保护excel一个

【步骤】

1、首先,打开受保护的Excel表格,按“ALT”+“F11”键,弹出如下的界面。

2、点击“插入”——“模块”,出现下图

于空白处添加如下代码:

  

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

点击“F5”运行宏模块,进行密码破解,出现如下图,密码为图中的圈圈

经过以上的步骤,此Excel的表格的密码已经自动除去,好了,现在你可以为所欲为了!

时间: 2024-12-14 18:48:43

【转载】如何破解受保护的excel密码的相关文章

Aspose.Cells 读取受保护的Excel

最近遇到一个需求,要能够读取受密码保护的Excel内容,之前都是直接读取Excel中的数据,不需要做任何其他的处理.   当Excel双击的时候,需要输入密码,在使用Aspose.Cells 组件读取的时候就会报错 Workbook book = new Workbook(fullFilename, new LoadOptions() { Password="111111" }); Worksheet sheet = book.Worksheets[0]; Cells cells =

[转载]如何破解Excel VBA密码

原文链接:http://yhf8377.blog.163.com/blog/static/1768601772012102111032840/ 在此之前,先强调一下,这个方法只是用来破解Excel内部的VBA工程,想要破解Excel文件打开密码的同学可以飘过…… 首先,如果文件格式是Excel 2010版(.xslm),需要先打开Excel文件,另存为2003版格式(.xls). 然后用普通的文本编辑器(我用的是NotePad++)打开这个文件,注意文件类型选“所有文件”. 然后在文件里查找“D

破解Excel受保护输入密码

第一.打开Excel表,按ALT+F11弹出界面后,点击插入--->模块把如下代码黏贴进去接着按F5,接下来都是确定即可. 使用方法:打开要解除保护的EXCEL ALT+F11----插入模块----复制粘贴代码----F5============================代码===================================Public Sub AllInternalPasswords()' Breaks worksheet and workbook structur

破解Excel2010受保护的工作薄

今天同事遇到一个Excel的问题,他忘记了工作薄保护的密码,以至于无法再编辑文档内的数据.所以跑过来求助.这个问题最后解决了,但个人觉得比较有意思,所以把这个方法发布出来,也权当是给自己做个笔记吧. 首先确认,他所使用的版本为64位英文版Office2010. 如果不输入受保护的工作薄密码,那么当尝试编辑工作薄的内容时会得到以下报错 中文意思是"您试图更改的单元格或图表受保护,因而是只读的.若要修改受保护单元格或图表,请先使用'撤消工作表保护'命令(在'审阅'选项卡的'更改'组中)来取消保护.可

教你看懂Excel密码破解工具结果对话框

Excel文档的密码可谓是Office所有产品中最复杂的,密码类型最多,还涉及密保程度较高的VBA密码.自然而然Excel密码破解工具的结果对话框也是稍微复杂,用户可能会看不懂其中的内容,下面将教你如何快速秒懂Excel密码破解工具的结果对话框. 解读Excel密码破解工具结果对话框 在Excel密码破解工具破解过程结束之后,不管是否破解成功,系统都会弹出密码对话框,对话框上的信息都是对此次密码破解结果的展示,破解成功的结果对话框如下图所示: Excel密码破解工具结果对话框的第一部分是密码区,

Excel密码破解究竟有多简单?

面对一个加了密的excel文件,要想打开怎么办?总不能一个密码一个密码的试吧...别担心,让小编来告诉你Excel密码破解究竟有多简单! 更多密码破解资讯:http://www.passwordrecovery.cn/ 小编先用Microsoft Office Excel 2003(可用金山WPS Office 2012 表格代替)创建一个"2003.xls"的普通方式加密Excel文档,然后用Office Password Remover这个在线破解工具来破解,1,2,3,3秒之后,

SQL SERVER 2012 尝试读取或写入受保护的内存。这通常指示其他内存已损坏。 (System.Data)

标题: 连接到服务器------------------------------无法连接到 192.168.1.253.------------------------------其他信息:尝试读取或写入受保护的内存.这通常指示其他内存已损坏. (System.Data)------------------------------按钮:确定------------------------------管理员身份运行 cmd -> netsh winsock reset***************

Mcafee Email-Gateway 阻挡受保护附件

在Email-Gateway设立之后,当收外部邮件带有密码保护的 Word,Excel, RAR文件时,Email-gateway 会默认阻挡,解决方法如下: 1.了解阻挡的邮件使用哪个策略: 2.点击电子邮件 --->内容处理--->遭破坏或无法读取的内容--->受保护的文件 3. 将选项改为 "允许通过(监控)": 4.  确认

浅谈软件的破解与保护

1.引言 开发软件时,尤其当用到商业用途时,注册码和激活码是非常重要的,未注册的用户会加上某些限制,如使用天数,延迟,未注册画面等等.但是现在的软件破解技术十分强大,各种国内外大型软件都有注册机制,却同时也不断地被破解,国家一再加大力度,打击非法软件出版物,扶持正版软件,但实际效果并不理想.大多的软件商选择了购买加密产品或者加密技术来保护自己的软件,软件保护一般分为软加密和硬加密. 2.常见的软件破解方法 首先我们来了解一下破解中几个重要的专业术语. (1)断点,所谓断点就是程序被中断的地方,中