下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2024-2030年中国全自动保管箱行业竞争策略及未来发展潜力分析报告
- 2024年发布:网络营销推广合作协议
- 2023年宁波通商基金管理有限公司招聘考试真题
- 2024年办公室装修设计验收合同
- 2023年浙江宁波大学附属人民医院招聘考试真题
- 2024年南京二手房买卖合同蓝本
- 2023年宁波鄞州银行招聘社会招聘考试真题
- 2024年二手手机购买协议
- 2024年定制:单次货物运输合同范例
- 2024年工程招标代理合同
- 电动汽车充电桩申请安装备案表
- 想起这件事-我就-课件
- 【核心素养目标】浙教版五上《劳动》项目二 任务二《制作七巧板》教学设计
- 云南省保山市各县区乡镇行政村村庄村名居民村民委员会明细
- 承台基础模板施工方案完整
- 高考议论文写作指导:议论文主体段落的写法 课件60张
- 社会主义从空想到科学的发展第二章课件
- 小学二年级上册《道德与法治》教材解读分析
- 我不生气了-完整版课件
- 云教版劳技七年级上册第二章第三节家庭理财技巧课件
- 测试转板记录表
评论
0/150
提交评论