




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、ExcelExcelExcelExcel“撤销工作表保护密码撤销工作表保护密码撤销工作表保护密码撤销工作表保护密码” ” ” ”的破解并获取原始密码的破解并获取原始密码的破解并获取原始密码的破解并获取原始密码 在日常工作中,您是否遇到过这样的情况:您用 Excel 编制的报表、表格、程序等,在单元 格中设置了公式、函数等,为了防止其他人修改您的设置或者防止您自己无意中修改,您可 能会使用 Excel 的工作表保护功能,但时间久了保护密码容易忘记,这该怎么办?有时您从 网上下载的 Excel 格式的小程序,您想修改,但是作者加了工作表保护密码,怎么办?您只 要按照以下步骤操作,Excel 工作表
2、保护密码瞬间即破! 1、打开您需要破解保护密码的 Excel 文件; 2、依次点击菜单栏上的工具-宏-录制新宏,输入宏名字如:aa; 3、停止录制(这样得到一个空宏); 4、依次点击菜单栏上的工具-宏-宏,选 aa,点编辑按钮; 5、删除窗口中的所有字符(只有几个),替换为下面的内容; 从横线下开始复制 - Option Explicit Public Sub AllInternalPasswords() Breaks worksheet and workbook structure passwords.Bob McCormick probably originator of basecode
3、algorithm modified for coverage of workbook structure / windowspasswords and for multiple passwords Norman Harker and JE McGimpsey 27-Dec-2002 (Version 1.1) Modified 2003-Apr-04 by JEM: All msgsto constants, and eliminate oneExit Sub (Version 1.1.1) Reveals hashed passwords NOT original passwords Co
4、nst DBLSPACE As String = vbNewLine & vbNewLine ConstAUTHORS 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
5、REPBACK As String = DBLSPACE & Please report failure& _ to the gramming newsgroup. ConstALLCLEAR As String = DBLSPACE & The workbook should& _ now be freeofallpassword protection, so make sure you: & _ DBLSPACE &SAVEIT NOW! & DBLSPACE & and also & _ DBLSPACE & BACKUP!, BACK
6、UP!, BACKUP! & _ DBLSPACE & Also, remember that the password was& _ put there fora reason. Dont stuff up crucial formulas& _ or data. & DBLSPACE & Access and useof somedata& _ may be an offense. Ifindoubt, dont. Const MSGNOPWORDS1 As String = There were no passwords on& _ sheets, or workbook structu
7、re or windows.& AUTHORS & VERSION Const MSGNOPWORDS2 As String = There was no protection to& _ workbook structureor windows. & DBLSPACE & _ Proceeding to unprotect sheets. &AUTHORS & VERSION Const MSGTAKETIME As String = After pressingOKbutton this& _ will take sometime. & DBLSPACE & Amount of time&
8、 _ depends on how many different passwords, the& _ passwords,and your computersspecification. & DBLSPACE & _ Just be patient! Make me a coffee! & AUTHORS & VERSION Const MSGPWORDFOUND1 As String =Youhad aWorksheet& _ Structureor Windows Password set.& DBLSPACE & _ The password found was:& DBLSPACE &
9、 $ & DBLSPACE & _ Noteitdown for potential future useinother workbooks by& _ the same person who set this password.& DBLSPACE & _ Now to check and clear other passwords. &AUTHORS & VERSION Const MSGPWORDFOUND2 As String =Youhad aWorksheet& _ password set.& DBLSPACE & The password found was:& _ DBLSP
10、ACE & $ & DBLSPACE & Noteitdown for potential& _ future useinother workbooks by sameperson who& _ set this password. & DBLSPACE & Now to check and clear& _ other passwords. & AUTHORS & VERSION Const MSGONLYONEAs String = Only structure/ windows& _ protected with thepassword that wasjust found. & _ A
11、LLCLEAR &AUTHORS & VERSION & REPBACK Dim w1As Worksheet, w2As Worksheet DimiAs Integer,jAs Integer, k As Integer,lAs Integer Dim m As Integer,n As Integer,i1As Integer,i2As Integer Dimi3As Integer,i4As Integer,i5As Integer,i6As Integer Dim PWord1 As String Dim ShTag As Boolean, WinTagAs Boolean Appl
12、ication.ScreenUpdating = False With ActiveWorkbook WinTag = .ProtectStructureOr .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,
13、 vbInformation, HEADER If Not WinTag Then MsgBox MSGNOPWORDS2, vbInformation, HEADER Else On Error ResumeNext Do dummy do loop Fori= 65 To 66: Forj= 65 To 66: For k = 65 To 66 Forl= 65 To 66: For m = 65 To 66: Fori1= 65 To 66 Fori2= 65 To 66: Fori3= 65 To 66: Fori4= 65 To 66 Fori5= 65 To 66: Fori6=
14、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= FalseAnd _ .ProtectWindows = False Then PWord1 = Chr(i) & Chr(j) & Chr(k)& Chr(l) & _ Chr(m) & Chr(i1)
15、& Chr(i2) & Chr(i3) & _ Chr(i4) & Chr(i5) & Chr(i6) & Chr(n) MsgBox Application.Substitute(MSGPWORDFOUND1, _ $, PWord1), vbInformation, HEADER Exit Do Bypassallfor.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 Wi
16、nTag And Not ShTag Then MsgBox MSGONLYONE, vbInformation, HEADER Exit Sub End If On Error ResumeNext For Each w1 In Worksheets Attempt clearancewith PWord1 w1.Unprotect PWord1 Next w1 On Error GoTo 0 ShTag = False For Each w1 In Worksheets Checksforallclear ShTag triggered to 1ifnot. ShTag = ShTag O
17、r w1.ProtectContents Next w1 If ShTag Then For Each w1 In Worksheets With w1 If .ProtectContents Then On Error ResumeNext Do Dummydo loop Fori= 65 To 66: Forj= 65 To 66: For k = 65 To 66 Forl= 65 To 66: For m = 65 To 66: Fori1= 65 To 66 Fori2= 65 To 66: Fori3= 65 To 66: Fori4= 65 To 66 Fori5= 65 To
18、66: Fori6= 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 .ProtectContentsThen 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(MSGPWORD
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025版房地产交易税费计算与申报服务合同
- 2025版生态农业与菜场承包联合发展合同
- 二零二五年度生物医药生产基地厂房租赁合同范本
- 2025版离婚协议书范本汇编与婚姻财产分割调解服务协议
- 二零二五年度汽车行业数据分析与应用合作协议合同
- 二零二五年度家居产品加工保密协议书
- 二零二五版泵车租赁及操作人员资质认证合同
- 二零二五年度自行车oem代加工合作协议书
- 二零二五年度文化用品采购合同样本及知识产权保护
- 2025年福建省福州市长乐区长乐高级中学物理高一下期末综合测试试题含解析
- 精益生产改善培训
- 大学生心理健康教育(兰州大学版)学习通超星期末考试答案章节答案2024年
- 浙江水利专业高级工程师任职资格考试题及答案
- 统计学数据的图表展示(共133张课件)
- GB/T 44208-2024馆藏文物病害描述及图示基础要素
- 2023四年级数学上册 1 大数的认识第11课时 用计算器计算教案 新人教版
- 中国共产党支部工作条例
- 2023年石嘴山市直机关遴选公务员考试真题
- GCP相关人员职责
- 2024广西公需课高质量共建“一带一路”谱写人类命运共同体新篇章答案
- “守住钱袋子 护好幸福家”防范和打击非法集资宣传
评论
0/150
提交评论