




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、破解EXCEL工作表保护 在日常工作中,您是否遇到过这样的情况:您用 Excel 编制的报表、表 格、程序等,在单元格中设置了公式、函数等,为了防止其他人修改您 的设置或者防止您自己无意中修改, 您可能会使用 Excel 的工作表保护 功能,但时间久了保护密码容易忘记,这该怎么办?有时您从网上下载 的 Excel 格式的小程序,您想修改,但是作者加了工作表保护密码,怎 么办?您只要按照以下步骤操作, Excel 工作表保护密码瞬间即破!1 、打开您需要破解保护密码的 Excel 文件;2 、依次点击菜单栏上的工具 - 宏 录制新宏,输入宏名字如:aa ;3 、停止录制 ( 这样得到一个空宏 )
2、 ;4 、依次点击菜单栏上的工具 - 宏 宏, 选 aa, 点编辑按钮;5 、删除窗口中的所有字符 ( 只有几个 ), 替换为下面的内容;Option ExplicitPublic Sub AllInternalPasswords() Breaks worksheet and workbook structure passwords. BobMcCormick probably originator of base code algorithm modified for coverage of workbook structure / windows passwords and for mul
3、tiple passwordsNorman 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 passwordsConst DBLSPACE As String = vbNewLine & vbNewLineConst AUTHORS As String = DBLSPACE & v
4、bNewLine & _Adapted from Bob McCormick base code by & _Norman Harker and JE McGimpseyConst HEADER As String = AllInternalPasswords User MessageConst VERSION As String = DBLSPACE & Version 1.1.1 2003-Apr-04Const REPBACK As String = DBLSPACE & Please report failure &to the gr
5、amming 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.
6、 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 workbook structure or windows. & AUTHORS & VERSION Const MSGNOPWORDS2 As String = There was no protectio
7、n 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 computers
8、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 workboo
9、ks 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
10、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. & _ ALLCLEAR & AUTHORS & VERSION & REPBACKDim w1 As Works
11、heet, 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 As BooleanApplication.ScreenUpdating = FalseWith A
12、ctiveWorkbookWinTag = .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 MSGTAKETIME, vbInformation, HEADERIf Not WinTag ThenMsgBox
13、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 66: For i6 = 65 To 66: For n = 32 To 126With Activ
14、eWorkbook.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) & Chr(i1) & Chr(i2) & Chr(i3) & _Chr(i4) & Chr(i5) &
15、 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 WinTag And Not ShTag ThenMsgBox MSGONLYONE, vbInformat
16、ion, HEADERExit SubEnd IfOn Error Resume NextFor Each w1 In WorksheetsAttempt clearance with PWord1 w1.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 Wo
17、rksheetsWith 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 66: For i6 = 65 To 66: For n = 32 To 126 .Unprotec
18、t 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) & Chr(i6) & Chr(n)MsgBox Application.Substitute(MSGPWORDFOUND2, _$, PWord1), vbInformation, HEADERleverage finding Pword by trying on other sheetsFor Each w2 In Worksheets w2.Unprotect PWord1Next w2Exit Do Bypass all for.nextsEn
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年如何应对烷基化工艺作业的面试挑战答案全解析
- 2025年建筑工程施工现场管理面试宝典与模拟题集
- 2025年软件开发工程师面试宝典知识点预测题
- 2025年物资储备仓库运输调度员职位面试高频词汇解析与答案
- 申诉业务知识培训课件
- 2025年中级炼油装置操作工技能考核大纲及样题解析
- 甲状腺超声TI-RADS分类课
- 脑卒中吞咽障碍护理
- 青少年普法宣传教育宣讲
- 单元统整教学课件模板
- 电动车充电应急处置预案
- 入学测试卷(一)(试题)-2024-2025学年五年级上册数学苏教版
- 医疗护理员培训机构申报表
- 半导体器件的干法刻蚀技术考核试卷
- 农商行贷款合同(2024版)
- 论行政决策的科学化与民主化分析研究 公共管理专业
- 专家讲课劳务合同书
- 少儿舞蹈剧目分析报告总结
- 班组长团队管理能力考试题库-上(选择题)
- 储能柜质保协议
- 医学精美课件《颈肩痛腰腿痛》讲座
评论
0/150
提交评论