如何解除EXCEL工作表锁定.doc

上传人:scccc 文档编号:10788463 上传时间:2021-06-04 格式:DOC 页数:11 大小:329.50KB
返回 下载 相关 举报
如何解除EXCEL工作表锁定.doc_第1页
第1页 / 共11页
如何解除EXCEL工作表锁定.doc_第2页
第2页 / 共11页
如何解除EXCEL工作表锁定.doc_第3页
第3页 / 共11页
如何解除EXCEL工作表锁定.doc_第4页
第4页 / 共11页
如何解除EXCEL工作表锁定.doc_第5页
第5页 / 共11页
点击查看更多>>
资源描述

《如何解除EXCEL工作表锁定.doc》由会员分享,可在线阅读,更多相关《如何解除EXCEL工作表锁定.doc(11页珍藏版)》请在三一文库上搜索。

1、参考医学在日常工作中,大家有时会遇到过这样的情况:使用Excel编制的报表、表格、程序等,在单元格中设置了公式、函数等,为了防止其他人修改您的设置或者防止您自己无意中修改,您可能会使用Excel的工作表保护功能,但时间久了保护密码容易忘记,这该怎么办?有时您从网上下载的Excel格式的小程序,您想修改,但是作者加了工作表保护密码,怎么办?您只要按照以下步骤操作,Excel工作表保护密码瞬间(稍微有点夸张)即破!步骤阅读百度经验: 工具/原料 待破解的Excel工作表百度经验: 方法/步骤1. 1打开您需要破解的Excel文件,如图所示:步骤阅读2. 2依次点击菜单栏上的工具-宏-录制新宏;步骤

2、阅读3. 3输入宏名字(PS:打击积极性啊!)如:易尔拓,然后停止录制(这样得到一个空宏,为后面添加vb代码做准备);步骤阅读4. 4依次点击菜单栏上的工具-宏-宏,选易尔拓,点编辑按钮;删除窗口中的所有字符,替换为下面的内容;Option ExplicitPublic Sub AllInternalPasswords() Breaks worksheet and workbook structure passwords. Bob McCormick probably originator of base code algorithm modified for coverage of work

3、book structure / windows passwords and for multiple passwords Norman 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 &

4、vbNewLineConst AUTHORS As String = DBLSPACE & vbNewLine & _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 repo

5、rt failure & _to the microsoft.public.excel.programming 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, rememb

6、er that the password was & _put there for a reason. 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 & VERSIONCo

7、nst MSGNOPWORDS2 As String = There was no protection to & _workbook structure or windows. & DBLSPACE & _Proceeding to unprotect sheets. & AUTHORS & VERSIONConst MSGTAKETIME As String = After pressing OK button this & _will take some time. & DBLSPACE & Amount of time & _depends on how many different

8、passwords, the & _passwords, and your computers specification. & DBLSPACE & _Just be patient! Make me a coffee! & AUTHORS & VERSIONConst MSGPWORDFOUND1 As String = You had a Worksheet & _Structure or Windows Password set. & DBLSPACE & _The password found was: & DBLSPACE & $ & DBLSPACE & _Note it dow

9、n for potential future use in other workbooks by & _the same person who set this password. & DBLSPACE & _Now to check and clear other passwords. & AUTHORS & VERSIONConst MSGPWORDFOUND2 As String = You had a Worksheet & _password set. & DBLSPACE & The password found was: & _DBLSPACE & $ & DBLSPACE &

10、Note it down for potential & _future use 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 & AUTH

11、ORS & VERSION & REPBACKDim w1 As Worksheet, 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 BooleanAp

12、plication.ScreenUpdating = FalseWith ActiveWorkbookWinTag = .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, vbInform

13、ation, HEADERIf Not WinTag ThenMsgBox 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 =

14、 65 To 66: For n = 32 To 126With 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 = False And _.ProtectWindows = False ThenPWord1 = Chr(i) & Chr(j) & Chr(k) & Chr(l) & _Chr(m) & Chr(i1) & Ch

15、r(i2) & Chr(i3) & _Chr(i4) & Chr(i5) & 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 S

16、hTag ThenMsgBox MSGONLYONE, vbInformation, HEADERExit SubEnd IfOn Error Resume NextFor Each w1 In WorksheetsAttempt clearance with PWord1w1.Unprotect PWord1Next w1On Error GoTo 0ShTag = FalseFor Each w1 In WorksheetsChecks for all clear ShTag triggered to 1 if not.ShTag = ShTag Or w1.ProtectContents

17、Next w1If ShTag ThenFor Each w1 In WorksheetsWith 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 =

18、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 .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

19、)MsgBox Application.Substitute(MSGPWORDFOUND2, _$, PWord1), vbInformation, HEADERleverage finding Pword by trying on other sheetsFor Each w2 In Worksheetsw2.Unprotect PWord1Next w2Exit Do Bypass all for.nextsEnd IfNext: Next: Next: Next: Next: NextNext: Next: Next: Next: Next: NextLoop Until TrueOn Error GoTo 0End IfEnd WithNext w1End IfMsgBox ALLCLEAR & AUTHORS & VERSION & REPBACK, vbInformation, HEADEREnd Sub步骤阅读5. 5依次点击菜单栏上的工具-宏-宏,选AllInternalPasswords,执行,确定两次; 耐心等一会,再点击两次确定,就ok啦!步骤阅读步骤阅读步骤阅读步骤阅读步骤阅读步骤阅读END原作者:易尔拓(注:表格素材和资料部分来自网络,供参考。只是收取少量整理收集费用,请预览后才下载,期待你的好评与关注)

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 社会民生


经营许可证编号:宁ICP备18001539号-1