2019年清除忘记excel加密文件方法(亲测可用)

上传人:公**** 文档编号:552541505 上传时间:2023-10-27 格式:DOCX 页数:4 大小:9.48KB
返回 下载 相关 举报
2019年清除忘记excel加密文件方法(亲测可用)_第1页
第1页 / 共4页
2019年清除忘记excel加密文件方法(亲测可用)_第2页
第2页 / 共4页
2019年清除忘记excel加密文件方法(亲测可用)_第3页
第3页 / 共4页
2019年清除忘记excel加密文件方法(亲测可用)_第4页
第4页 / 共4页
亲,该文档总共4页,全部预览完了,如果喜欢就下载吧!
资源描述

《2019年清除忘记excel加密文件方法(亲测可用)》由会员分享,可在线阅读,更多相关《2019年清除忘记excel加密文件方法(亲测可用)(4页珍藏版)》请在金锄头文库上搜索。

1、去除 Excel 工作表保护密码 很有用的小工具 :)操作步骤:1. 打开需要破解密码的 Excel;2. Alt+F11,进入 VBA编辑界面;3. 插入 - 模块 (Module) ;4. 在右边 Module 的空白编辑区域,复制粘贴下面所有内容;5. F5,运行该VBA命令;Option ExplicitPublic Sub AllInternalPasswords() Breaks worksheet and workbook structure passwords. Bob McCormick probably originator of base code algorithm m

2、odified for coverage of workbook structure / windows passwords and for multiple passwordsI 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 DBL

3、SPACE As String = vbNewLine & vbNewLine Const AUTHORS As String = DBLSPACE & vbNewLine & _ Adapted from Bob McCormick base code by & _ Norman Harker and JE McGimpseyConst HEADER As String = AllInternalPasswords User Message Const VERSION As String = DBLSPACE & Version 1.1.1 2003-Apr-04 Const REPBACK

4、 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!, BAC

5、KUP!, BACKUP! & _ DBLSPACE & Also, remember that the password was & _ put there for a reason. Dont stuff up crucial formulas & _ or data. & DBLSPACE & Access and use of some data & _ may be an offense. If in doubt, dont.Const MSGNOPWORDS1 As String = There were no passwords on & _ sheets, or workboo

6、k 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

7、& Amount of time & _ depends on how many different passwords, the & _ passwords, and your computers 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 pass

8、word 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. & DBL

9、SPACE & 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 & VERSIONConst MSGONLYONE As String = Only structure / windows & _ pr

10、otected with the password that was just found. & _ ALLCLEAR & AUTHORS & VERSION & REPBACKDim w1 As Worksheet, w2 As WorksheetDim 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

11、Integer Dim PWord1 As StringDim ShTag As Boolean, WinTag As BooleanApplication.ScreenUpdating = FalseWith ActiveWorkbookWinTag = .ProtectStructure Or .ProtectWindowsEnd WithShTag = FalseFor Each w1 In WorksheetsShTag = ShTag Or w1.ProtectContentsNext w1If Not ShTag And Not WinTag ThenMsgBox MSGNOPWO

12、RDS1, vbInformation, HEADERExit SubEnd IfMsgBox MSGTAKETIME, vbInformation, HEADERIf Not WinTag ThenMsgBox MSGNOPWORDS2, vbInformation, HEADER ElseOn Error Resume NextDo dummy do loopFor i = 65 To 66: For j = 65 To 66: For k = 65 To 66For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66For i2 = 65

13、To 66: For i3 = 65 To 66: For i4 = 65 To 66For 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

14、ThenPWord1 = 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, HEADERExit Do Bypass all for.nextsEnd IfEnd WithNext: Next: Next: Next: Next: NextNext: Next: Next:

15、 Next: Next: NextLoop Until TrueOn Error GoTo 0End IfIf WinTag And Not ShTag ThenMsgBox MSGONLYONE, vbInformation, HEADERExit SubEnd IfOn Error Resume NextFor Each w1 In WorksheetsAttempt clearance with PWord1w1.Unprotect PWord1Next w1On Error GoTo 0ShTag = FalseFor Each w1 In WorksheetsChecks for all clear ShTag triggered to 1 if not.ShTag = ShTag Or w1.ProtectContentsNext w1If ShTag ThenFor Each w1 In WorksheetsWith w1If .ProtectContents ThenOn Error Resume NextDo Dummy do loopFor i = 65 To 66:

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 外语文库 > 英语听力

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号