



下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、EXCEL文件去掉工作表保护密码的方法1、 打开需要解除保护的EXCEL工作表;2、 选择工具 宏录制新宏 输入名字如:aa ;3、停止录制(这样得到一个空宏);4、工具 宏宏,选aa,点编辑按钮;5、 删除窗口中的所有字符(只有几个),替换为下面的内容:(复制吧);6、关闭编辑窗口;7、 工具 宏宏,选AllinternalPasswords,运行,确定两次,等2分钟,再确定.0K,旧的密码自动提 示,工作表也自动解除保护了。需拷贝内容如下Public Sub AllI nter nalPasswords()'Breaks worksheet and workbook structu
2、re passwords. Bob McCormick'probably origi nator of base code algorithm modified for coverage'of workbook structure / win dows passwords and for multiple passwords'Norma n Harker and JE McGimpsey 27-Dec-2002 (Versio n 1.1)'Modified 2003-Apr-04 by JEM: All msgs to con sta nts, and'
3、;eliminate one Exit Sub (Version 1.1.1)'Reveals hashed passwords NOT orig inal passwordsConst DBLSPACE As Stri ng = vbNewLi ne & vbNewL ineConst AUTHORS As Stri ng = DBLSPACE & vbNewL ine & _"Adapted from Bob McCormick base code by" & _"Norman Harker and JE McGimps
4、ey"Const HEADER As Stri ng = "AllI nternalPasswords User Message"Con st VERSION As Stri ng = DBLSPACE & "Versio n 1.1.1 2003-Apr-04" Co nst REPBACK As Stri ng = DBLSPACE & "Please report failure " & _ "to the gramming news
5、group."Con st ALLCLEAR As Stri ng = DBLSPACE & "The workbook should " & _ "now be free of all password protecti on, so make sure you:" & _ DBLSPACE & "SAVE IT NOW!" & DBLSPACE & "and also" & _ DBLSPACE & "BACKUP!, BACK
6、UP!, BACKUP!" & _DBLSPACE & "Also, remember that the password was " & _"put there for a reas on. Don't stuff up crucial formulas " & _"or data." & DBLSPACE & "Access and use of some data " & _"may be an offen se. If i
7、n doubt, don't."Con st MSGNOPWORDS1 As Stri ng = "There were no passwords on " & _ "sheets, or workbook structure or win dows." & AUTHORS & VERSION Con st MSGNOPWORDS2 As Stri ng = "There was no protectio n to " & _ "workbook structure or w
8、in dows." & DBLSPACE &"Proceed ing to un protect sheets." & AUTHORS & VERSIONConst MSGTAKETIME As String = "After pressing OK button this " & _ "will take some time." & DBLSPACE & "Amount of time " & _ "depe nds on how
9、 many differe nt passwords, the " & _"passwords, and your computer's specification " & DBLSPACE & _ "Just be patie nt! Make me a coffee!" & AUTHORS & VERSION Const MSGPWORDFOUND1 As Stri ng = "You had a Worksheet " & _ "Structure or
10、 Win dows 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 &
11、_ "Now to check and clear other passwords." & AUTHORS & VERSION Const MSGPWORDFOUND2 As Stri ng = "You had a Worksheet " & _ "password set." & DBLSPACE & "The password found was: " & _ DBLSPACE & "$" & DBLSPACE & &
12、quot;Note it down for potential " & _ "future use in other workbooks by same pers on who " & _"set this password." & DBLSPACE & "Now to check and clear " & _ "other passwords." & AUTHORS & VERSIONConst MSGONLYONE As String = &q
13、uot;Only structure / windows " & _ "protected with the password that was just foun d." & _ ALLCLEAR & AUTHORS & VERSION & REPBACKDim w1 As Worksheet, w2 As WorksheetDim i As In teger, j As In teger, k As In teger, l As In tegerDim m As In teger, n As In teger, i1 A
14、s In teger, i2 As In tegerDim i3 As In teger, i4 As In teger, i5 As In teger, i6 As In tegerDim PWordl As Stri ngDim ShTag As Boolea n, WinTag As Boolea nApplicati on .Scree nUpdat ing = FalseWith ActiveWorkbookWin Tag = .ProtectStructure Or .ProtectWi ndowsEnd WithShTag = FalseFor Each w1 In Worksh
15、eetsShTag = ShTag Or wl.ProtectCo ntentsNext w1If Not ShTag And Not Win Tag The nMsgBox MSGNOPWORDS1, vbI nformatio n, HEADERExit SubEnd IfMsgBox MSGTAKETIME, vb In formati on, HEADERIf Not Win Tag The nMsgBox MSGNOPWORDS2, vbI nformatio n, HEADERElseOn Error Resume NextDo 'dummy do loopFor i =
16、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 With ActiveWorkbook.Un protect Chr(i) & Chr(j) & Chr(k) & _Chr(l) & Chr(m) &
17、amp; Chr(i1) & Chr(i2) & _Chr(i3) & Chr (i4) & Chr(i5) & Chr(i6) & Chr( n)If .Protectstructure = False And _.ProtectWi ndows = False The nPWord1 = Chr(i) & Chr(j) & Chr(k) & Chr(l) & _Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _Chr(i4) & Chr(i5
18、) & Chr(i6) & Chr (n)MsgBox Applicatio n.Substitute(MSGPWORDFOUND1, _"$", PWord1), vbI nformatio n, HEADERExit Do 'Bypass all for. nextsEnd IfEnd WithNext: Next: Next: Next: Next: NextNext: Next: Next: Next: Next: NextLoop Un til TrueOn Error GoTo 0End IfIf WinTag And Not ShTag
19、 The nMsgBox MSGONLYONE, vbI nformatio n, HEADERExit SubEnd IfOn Error Resume NextFor Each w1 In Worksheets'Attempt cleara nee with PWord1w1. Un protect PWordlNext w1On Error GoTo 0ShTag = FalseFor Each w1 In Worksheets'Checks for all clear ShTag triggered to 1 if not.ShTag = ShTag Or wl.Pro
20、tectCo ntentsNext w1If ShTag The nFor Each w1 In WorksheetsWith w1If .ProtectC on te nts The nOn 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.Un protect Chr(i) & Chr(j) & Chr(k) & _Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _Chr(i4) &
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年度高端珠宝店面特许经营权转让协议书
- 二零二五年度员工持股合伙协议书:新能源车辆研发团队股权激励与市场推广协议
- 二零二五年度实习就业协议书:地质勘探实习合同范本
- 二零二五年度文化产业合作协议解读:简述概念特点与文化创新
- 二零二五年度夫妻双方婚内财产保全与收益分配协议
- 二零二五年度夫妻财产保全及婚姻风险防范合同
- 二零二五年度民事调解协议书生效后的履行监督与法律援助
- 发展改革委电力安全生产总结
- 餐饮服务人员心态培训
- 加工项目分包合同范例
- 中职高教版(2023)语文职业模块-第五单元:走近大国工匠(二)学习工匠事迹 领略工匠风采【课件】
- 2024年山东省济南市中考地理试题卷(含答案解析)
- 2024年太原城市职业技术学院高职单招数学历年参考题库含答案解析
- DB31∕T 795-2014 综合建筑合理用能指南
- GB/T 44979-2024智慧城市基础设施紧凑型城市智慧交通
- 戏剧课程设计方案
- 2025年保密知识试题库附参考答案(精练)
- 物料提升机安全技术操作规程(4篇)
- 临床微生物学检验技术知到智慧树章节测试课后答案2024年秋济宁医学院
- 分级护理质量考核标准
- 食品厂卫生安全员工培训
评论
0/150
提交评论