excel工作表密码破解方法.docx

上传人:11****ws 文档编号:2123227 上传时间:2019-04-29 格式:DOCX 页数:10 大小:626.56KB
下载 相关 举报
excel工作表密码破解方法.docx_第1页
第1页 / 共10页
excel工作表密码破解方法.docx_第2页
第2页 / 共10页
excel工作表密码破解方法.docx_第3页
第3页 / 共10页
excel工作表密码破解方法.docx_第4页
第4页 / 共10页
excel工作表密码破解方法.docx_第5页
第5页 / 共10页
点击查看更多>>
资源描述

1、excel 工作表密码破解方法在日常工作中,大家有时会遇到过这样的情况:使用 Excel 编制的报表、表格、程序等,在单元格中设置了公式、函数等,为了防止其他人修改您的设置或者防止您自己无意中修改,您可能会使用 Excel 的工作表保护功能,但时间久了保护密码容易忘记,这该怎么办?有时您从网上下载的 Excel 格式的小程序,您想修改,但是作者加了工作表保护密码,怎么办?您只要按照以下步骤操作,Excel 工作表保护密码瞬间(稍微有点夸张) 即破!打开您需要破解的 Excel 文件,如图所示:1、点击视图按钮依次录制宏2、输入名字入破解密码然后点确定3、查看宏然后编辑4、出现下图窗口5、删除窗

2、口中的所有字符,替换为下面的内容;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-D

3、ec-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 passwordsConst DBLSPACE As String = vbNewLine & vbNewLineConst AUTHORS As String = DBLSPACE & vbNewLine & _“Adapted from Bob McCormick base code

4、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

5、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. Dont stuff up cru

6、cial 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 workbook structure or windows.“ & AUTHORS & VERSIONConst MSGNOPWORDS2 As String = “There was no protection t

7、o “ & _“workbook structure or windows.“ & DBLSPACE & _“Proceeding to unprotect sheets.“ & AUTHORS & VERSIONConst 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 you

8、r computers specification.“ & DBLSPACE & _“Just be patient! Make me a coffee!“ & AUTHORS & VERSIONConst 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

9、 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

10、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 “ & _“protected with the password that was just found.“ & _ALL

11、CLEAR & AUTHORS & VERSION & REPBACKDim w1 As Worksheet, w2 As WorksheetDim i As Integer, j As Integer, k As Integer, l As IntegerDim m As Integer, n As Integer, i1 As Integer, i2 As IntegerDim i3 As Integer, i4 As Integer, i5 As Integer, i6 As IntegerDim PWord1 As StringDim ShTag As Boolean, WinTag

12、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 MSGNOPWORDS1, vbInformation, HEADERExit SubEnd IfMsgBox MSGTAKETI

13、ME, vbInformation, HEADERIf Not WinTag ThenMsgBox MSGNOPWORDS2, vbInformation, HEADERElseOn 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 To 66: For i3 = 65 To 66: For i4 = 65 To 66For i5 = 65 To

14、66: For i6 = 65 To 66: For n = 32 To 126With 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 ThenPWord1 = Chr(i) & Chr(j) & Chr(k) & Chr(l) & _Chr(m) &

15、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: Next: Next: NextLoop Until TrueOn Error GoTo 0End IfIf Wi

16、nTag 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.P

17、rotectContentsNext w1If ShTag ThenFor Each w1 In WorksheetsWith w1If .ProtectContents ThenOn 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 To 66: For i3 = 65 To 66: For i4 = 65 To 66For i5 = 65 To

18、 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 ThenPWord1 = Chr(i) & Chr(j) & Chr(k) & Chr(l) & _Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _Chr(i4) & Chr(i5) & C

19、hr(i6) & Chr(n)MsgBox Application.Substitute(MSGPWORDFOUND2, _“$“, PWord1), vbInformation, HEADERleverage finding Pword by trying on other sheetsFor Each w2 In Worksheetsw2.Unprotect PWord1Next w2Exit Do Bypass all for.nextsEnd IfNext: Next: Next: Next: Next: NextNext: Next: Next: Next: Next: NextLoop Until TrueOn Error GoTo 0End IfEnd WithNext w1End IfMsgBox ALLCLEAR & AUTHORS & VERSION & REPBACK, vbInformation, HEADEREnd Sub6、查看宏,然后点击执行7、弹出以下 4 个窗口依次点确定。8、最后一步确定后密码就已 经去除了。

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 实用文档资料库 > 策划方案

Copyright © 2018-2021 Wenke99.com All rights reserved

工信部备案号浙ICP备20026746号-2  

公安局备案号:浙公网安备33038302330469号

本站为C2C交文档易平台,即用户上传的文档直接卖给下载用户,本站只是网络服务中间平台,所有原创文档下载所得归上传人所有,若您发现上传作品侵犯了您的权利,请立刻联系网站客服并提供证据,平台将在3个工作日内予以改正。