



下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 音乐说课课件资源获取
- 油田开发项目经济效益和社会效益分析报告
- xx片区城乡供水一体化项目数字化方案(参考模板)
- 乡村治理结构优化实施方案
- 2025年油气钻采服务项目建议书
- 挖掘优势-树立科学就业观
- 2025年房地产市场区域分化与产业升级关系及投资策略分析报告
- 工业互联网平台数据清洗算法在工业物联网中的应用场景对比报告
- 探讨游戏化教学法在幼儿教育中的应用研究
- 医疗器械注册审批制度改革背景下2025年行业竞争格局与市场趋势分析
- 2025年食品检验员考试试卷及答案
- 四川省德阳市2025年七年级下学期语文期末试卷及答案
- 黎族文化课件
- 中华人民共和国民营经济促进法
- 色彩的魅力:艺术、科学与设计的交融
- 2025广州市荔湾区辅警考试试卷真题
- 一季度安委会汇报材料
- 贵州省遵义市2024年八年级《数学》上学期期末试题与参考答案
- 产品质量问题追溯制度
- TACE围手术期的护理
- GB/T 320-2025工业用合成盐酸
评论
0/150
提交评论