打开需要破解保护密码的Excel文件

1、打开您需要破解保护密码的Excel文件;
    2、依次点击菜单栏上的工具---宏----录制新宏,输入宏名字如:aa;
    3、停止录制(这样得到一个空宏);
    4、依次点击菜单栏上的工具---宏----宏,选aa,点编辑按钮;
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、关闭编辑窗口;
    7、依次点击菜单栏上的工具---宏-----宏,选AllInternalPasswords,运行,确定两次;
    等一会,就会出现以下对话框:这就是Excel密码对应的原始密码(此密码和原先设置的密码都能打开此文档。如果是别人的文档,你又想恢复密码设置,就可以用此密码进行保护,他就能用他设置的密码打开,你可以试试,很有趣的。字母一定要大写):

时间: 2024-10-01 06:53:20

打开需要破解保护密码的Excel文件的相关文章

用python读取带密码的excel文件中的数据

用python读取带密码的excel文件中的数据,程序代码如下: #filename:readingxls.py ''' 此程序的作用为:用python读取带密码的excel文件中的数据. 首先通过pip安装xlrd第三方库 pip3 install xlrd 请输入excel文件路径:D:\x1.xls ''' import xlrd path=input("请输入excel文件路径:") workbook=xlrd.open_workbook(path) b=len(workboo

Excel解除'工作表保护密码',并复原密码设定

前提要求 Office 2003(也就是老版的.xls文件) 用到宏操作 可以解除[审阅->保护工作表]的密码保护,其他的密码保护不能处理. 解决方案 打开需解除保护密码的Excel文件(.xls): 从菜单栏里找到并打开[录制宏]: 点击[停止录制](这样得到一个空宏): 点击[宏],找到刚刚录制的宏,点击编辑: 删除窗口中的所有代码,替换为下面的内容: 如果菜单没有上述描述的按钮,可以在[文件->选项->自定义功能区]找 Ctrl+S保存关闭编辑窗口: 点击[宏],找到刚刚录制的宏,

Microsoft Excel 文件未完全加载

今天(具体说是昨天)处理一个90多M的csv文件,一打开,报错"文件未完全加载", 这什么情况啊,我还想另存为xlsx的,这样就可以导入SQL Server了!(Easy,我知道csv等平面文件也可以导入SQL Server) 我以为文件坏了呢,毕竟这么大,这么多年,第一次打开90多M的csv(excel)文件.重新打开还是一样的问题. 只好点击"显示帮助",才知道原因,原来excel的行列数不能超过1,048,576行和16,384列的限制.才想起是这个问题,ex

EXCEL工作表保护密码破解方式

Excel工作表密码保护的解除方法 Excel弹出"您试图更改的单元格或图表受保护,因而是只读的.若要修改受保护单元格或图表,请先使用'撤消工作表保护'命令(在'审阅'选项卡的'更改'组中)来取消保护.可能会提示您输入密码. 出现这种情况,应该怎么解决呢?经过研究,找到了两种破解Excel工作表保护码的方法. 一.VBA宏代码破解法: 第一步:打开该文件 第二步:按Alt+F11,进入VBA编辑界面: 第三步:插入一个Module: 第四步:在右边Module的空白编辑区域,复制粘贴下面的所有内

Excel工作表保护密码破解的宏代码

        下了个微软软研究院的开发组实习生申请表,想填却填不进去.         原来他对工作表做了锁定,还有密码,我猜测他不是故意坑人的,想申微软的人连这点手段都没有人家也不会要的.下面的宏代码就是来破工作表锁定的. <span style="font-size:12px;color:#000000;">Public Sub 工作表保护密码破解() Const DBLSPACE As String = vbNewLine & vbNewLine Const

取消excel 工作保护 密码的宏

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 passw

如何取消Word文档保护密码(密码的破解方法)

Word-“取消文档保护”密码的破解方法 方法一(简单有效): 启动word 文档,新建一个空白文档,执行“插入文件” 命令,打开“插入文件”对话框,定位到需要解除保护的文档所在的文件夹,选中该文档,单击“插入”按钮,将加密保护的文档插入到新文档中,文档保护会被自动撤销. 方法二: 打开文档后,将其另存为XML 文件,然后用UltraEdit(或者EditPlus,下载华军里搜索一下就行了)这个编辑软件打开刚刚存储的XLM 文件,查找 ,这个“******" 是可变的.只需要找到这段文字,然后删

AOPR破解Office Word和Excel文档密码有风险吗?

Advanced Office Password Recovery作为一款专业的Office密码破解软件,支持的破解文件格式齐全,从Office2.0到2013版本.可破解的密码类型众多,从常设的打开密码到鲜有的VBA程序密码.所以,AOPR破解Office 97/2000兼容格式的Word和Excel文档密码,根本就是小菜一碟. AOPR与AOPB的破解效果 当需要破解密码的Word或Excel文档以Office 97/2000兼容格式或优于Office 97/2000格式保存时,Advanc

Java 加密Excel文件(打开时需输入密码)

收集:author: lifq package com.XXX.XXX.utils;import java.io.IOException; import com.jxcell.CellException;import com.jxcell.View; /** *  * @ClassName: DataExcels  * @Description: Excel加密解密 * @date: 2016-6-12 上午11:00:31  * @version */public class EncryptE