如何解密excel文件的教程
发布时间:2023-07-28 00:35:12
在Excel中经常需要录入重要的数据却不想被他人随意篡改,这个时候就需要用到Excel的密码保护功能,但也会有时候会忘记密码,这个时候就需要用到破解密码的手段了。下面是小编带来的关于如何解密excel文件的教程,欢迎阅读!
如何解密excel文件的教程:
解密步骤1:打开您需要破解保护密码的Excel文件;
解密步骤2:依次点击菜单栏上的工具—宏—-录制新宏,输入宏名字如:aaa;
解密步骤3:停止录制(这样得到一个空宏);
解密步骤4:依次点击菜单栏上的工具—宏—-宏,选aaa,点编辑按钮;
解密步骤5:删除窗口中的所有字符(只有几个),替换为下面的内容; Option ExplicitPublic 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 & "andalso" & _ 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 & VERSIONConst MSGPWORDFOUND2 As String = "You had a Worksheet " & _ "password set." & DBLSPACE & "The password found was:" & _ DBLSPACE & "$$" & DBLSPACE & "Note it down forpotential " & _ "future use in other workbooks by same person who " & _ "set this password." & DBLSPACE & "Now to check andclear " & _ "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 BooleanApplication.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,运行,确定两次;
解密步骤8:等一会,再点击确定,没有密码了!
猜你喜欢
- 有时我们可以看到word文档中有音频文件,这个是怎么实现的呢?那么下面就由小编给大家分享下为word插入音频文件的技巧,希望能帮助到您。为w
- ①启动Word2007,点击菜单栏--页面设置,单击稿纸设置按钮。 ②弹出稿纸设置界面,我们可以选择格式、颜色、行
- 在办公软件OFFICE里语言设置是很简单的,下面就以EXCLE为例。1、打开Excel表格,然后点击“文件”选项2、点击“选项”3、进入界面
- excel中如何制作表格呢?下面小编来教大家。01、首先,我们打开我们的电脑,然后我们打开我们电脑上面的excel,之后我们选中我们想要制作
- 在使用word编辑文档内容,都是进行编辑word文档的内容的是带我们需要内容和页面设置信息,有时我们调整word的页面设置内容信息,那么下面
- win10开机屏幕狂闪不停如何解决?如果win10开机屏幕给你来段狂闪画面,你会作何感想。不是win10看到你开机很开心,而是内部出错了。按
- win10系统已经深入人们的生活。基本上,各行各业都应用了win10系统。随着win10系统的大规模应用,许多小问题也逐渐出现。例如,虽然启
- 方法一:ctrl+A,全选格式---段落----中文版式------将“允许西文在单词中间换行”选中,确定。或者您在网上复制文档后,打开wo
- 之前一篇文中的公式“=SUMPRODUCT(($C$2:$C$14=C2)*($D$2:$D$14>=D2))”出现了bug——如果在
- 日常生活办公中,我们经常使用“Ctrl+V”进行粘贴操作。但是在Word2010中,用户可以将键盘上的Insert键作为粘贴命令的快捷键,不
- WPS论文如何设置不同页码首先要为各部分分节,即将论文分成不同部分。操作步骤1、为方便查看分节情况,先点击开始,显示段落标记。
- 数据乱码一般的情况下是很少会遇到的,那要是一不小心就发生在你的身上,你会怎么解决了?以下是我为大家总结的几点不同数据乱码问题以及解决方法。一
- 工作中经常要打开包含很多行记录的Excel表格查看数据有木有?你有过往下拖拉表格的时候,突然找不到数据对应的列标题的时候呢?这时你会怎么做?
- 如果你重新启动你的电脑,发现word无缘无故地开始了,别担心。可能是因为你的win10中的一个设置是默认打开的,对吧!至少不要担心木马或病毒
- 如何在Word 2016中使用制表符标签?“制表符”选项卡在页面上显示的位置显示一系列点或其他字符。在Word 2016中按Tab键,插入指
- 首先选中一列,平白增加了很多工作量,长度填写11再点击确定,然后单击数据验证,填写你了解到的费用范围,数据选择介于,比如手机号那列好了。性别
- word2007需要加封面以及目录,页码要求从正文开始,所以文档前几页不能显示页码,怎么设置呢?word2007前几页不显示页码的设置方法其
- 从网上下载下来的excel表格打开时功能区下方的消息栏中会显示一条警告信息,如下图所示,同时还会显示用于启用编辑的选项,很多朋友想退出受保护
- win10系统更新后一般不会出现任何问题!但是在这么多win10系统用户中,总有一些特殊的例子!最近,许多合作伙伴回应说,他们的win10系
- pdf怎么转成word文档?1打开PDF文档,复制全文;然后,在Word中粘贴。如果文档格式不复杂,这样得到的结果就够用了。