如何取消Excel工作表密码保护教程_第1页
如何取消Excel工作表密码保护教程_第2页
如何取消Excel工作表密码保护教程_第3页
如何取消Excel工作表密码保护教程_第4页
如何取消Excel工作表密码保护教程_第5页
已阅读5页,还剩1页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、Excel工作表保护密码清除1 .打开需要解除保护的EXCEL工作表:2 .选择匚具一宏一录制新宏一输入名字如:aa:3 .停止录制(这样得到一个空宏):4 .工具一宏宏,选aa,点编辑按钮:5 .删除窗口中的所有字符(只有几个),替换为下面的内容:(复制吧):6 .关闭编辑窗口37 . 1具一宏-宏,选AIHntemalPasswords,运行,确定两次,等2分钟,再确定QK,旧的密码自动提示,1:作表也自动解除 保护了 内容如下:Public Sub AlllntemalPasswordsO'Breaks worksheet and workbook structure passw

2、ords. Bob McCormick 'probably originator of base code algorithm modified for coverage 'of workbook 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 'eliminat

3、e one Exit Sub (Version 1.1.1)'Reveals hashed passwords NOT original passwords Const DBLSPACE As String = vbNewLine & vbNewUne Const AUTHORS As String = DBLSPACE & vbNewLine & _ 9/IAdapted from Bob McCormick base code by &_ Norman Harker and JE McGimpseyConst HEADER As String =Al

4、llnternalPasswords User Message Const VERSION As String = DBLSPACE & Version 1.1.1 2003-Apr-04 Const REPBACK As String = DBLSPACE & Please report failure & _ o the gramming newsgroup.Const ALLCLEAR As String = DBLSPACE & The workbook should & _ow be free

5、 of all password protection, so make sure you: & _ DBLSPACE & SAVE IT NOW! & DBLSPACE & and also & _ DBLSPACE & BACKUP!, BACKUP!, BACKUP! & _ DBLSPACE & Also, remember that the password was & _ put there for a reason. Don't stuff up cnicial formulas & _ or

6、 data. & DBLSPACE & Access and use of some data & _ may be an offense. If in doubt, don't.Const MSGNOPWORDS1 As String = There were no passwords on &_ sheets, or workbook structure or windows. & AUTHORS & VERSION Const MSGNOPWORDS2 As String = There was no protection to &

7、amp; 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 passwords, the &

8、 _ passwords, and your computer's specification. & DBLSPACE & _ 9 /2Just 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 &

9、amp; SS & DBLSPACE & _ Note it down for potential future use in other workbooks by & _he same person who set this password. & DBLSPACE & _ Now to check and dear other passwords. & AUTHORS & VERSION Const MSGPWORDFOUND2 As String = You had a Worksheet & _ password set.

10、 & DBLSPACE & The password found was: & _ DBLSPACE &SS& DBLSPACE & Note it down for potential & _uture use in other workbooks by same person who & _ set this password. & DBLSPACE & Now to check and clear & other passwords. & AUTHORS & VERSIONConst

11、MSGONLYONE As String = Only structure / windows & protected with the password that was just found. & _ ALLCLEAR & AUTHORS & VERSION & REPBACKDim w1 As Worksheet, w2 As WorksheetDim i As Integer, j As Integer, k As Integer, I As IntegerDim m As Integer, nAs Integer, i1 As Integer,

12、 i2 As IntegerDim i3 As Integer, i4 As Integer, i5As Integer, i6As IntegerDim PWordl As StringDim ShTag As Boolean, WinTag As BooleanApplication.ScreenUpdating = False9/3With ActiveWorkbookWinTag = .Protectstructure Or .ProtectWindowsEnd WithShTag = FalseFor Each w1 In WorksheetsShTag = ShTag Or w1.

13、ProtectContentsNext w1If Not ShTag And Not WinTag ThenMsgBox MSGNOPWORDS1, vblnformation, HEADERExit SubEnd IfMsgBox MSGTAKETIME, vblnformation, HEADERIf Not WinTag ThenMsgBox MSGNOPWORDS2, vblnformation, HEADERElseOn Error Resume NextDo 'dummy do loopFor i = 65 To 66: For j = 65 To 66: For k =

14、65 lb 66For I = 65 To 66: For m = 65 To 66: Foril = 65 To 66For i2 = 65 lb 66: For i3 = 65 To 66: For i4 = 65 7b 66For i5 = 65 Tb 66: For i6 = 65 To 66: For n = 32 To 126With ActiveWorkbook.Unprotect Chr(i) & Chr(j) & Chr(k) & _9/4Chr(l) & Chr(m) & Chr(i1)& Chr(i2) & _Chr

15、(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)If .ProtectStructure = False And _ .ProtectWindows = False ThenPWordl = 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 Applic

16、ation.Substitute(MSGPWORDFOUND1 $, PWordl), vblnformation, 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 ShTag ThenMsgBox MSGONLYONE, vblnformation, HEADERExit SubEnd IfOn

17、 Error Resume NextFor Each w1 In Worksheets9/5'Attempt clearance with PWordlw1.Unprotect PWordlNext w1On Error GoTo 0ShTag = FalseFor Each w1 In Worksheets,Checks for all clear ShTag triggered to 1 if not.ShTag = ShTag Or w1.ProtectContentsNext w1If ShTag ThenFor Each w1 In WorksheetsWith w1If .

18、ProtectContents ThenOn Error Resume NextDo 'Dummy do loopFor i = 65 To 66: For j = 65 To 66: For k = 65 Tb 66For I = 65 To 66: For m = 65 To 66: Foril = 65 To 66For i2 = 65 Tb 66: For i3 = 65 To 66: For i4 = 65 To 66For i5 = 65 Tb 66: For i6 = 65 To 66: For n = 32 To 126 .Unprotect Chr(i) &

19、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 Then9/6PWordl = Chr(i) & Chr(j) & Chr(k) & Chr(l) & _Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _Chr(i4)

20、& Chr(i5) & Chr(i6) & Chr(n)MsgBox Application.Substitute(MSGPWORDFOUND2, _$, PWordl), vblnformation, HEADER'leverage finding Pword by trying on other sheetsFor Each w2 In Worksheetsw2.Unprotect PWordlNext w2Exit Do 'Bypass all for.nextsEnd IfNext: Next: Next: Next: Next: NextNex

21、t: Next: Next: Next: Next: NextLoop Until TrueOn Error GoTo 0End IfEnd WithNext w1End IfMsgBox ALLCLEAR & AUTHORS & VERSION & REPBACK, vblnformation, HEADEREnd Sub9 /7Excel表格密码保护的解除方法表格受密码保护时,我们修改数据Excel弹出“您忒图更改的单元格或图表受保护因而是只读的。若要修改受保护单 元格或图表,请先使用撤消匚作表保护命令(在'审阅选项卡的更改'组中)来取消保护。可能会

22、提示您输入密码:这 时候我们可以用VBA宏代码破解法来破解表格保护密码:第一步:打开该文件,先解除默认的“宏禁用”状态,方法 是点击工具栏下的“选项”状态按钮,打开“Microsoft Office安全选项”窗口,选择其中的“启用此内容二“确定、 再切换到“视性T选项卡.点击“宏”一“录制宏”,出现“录制新宏”窗口.在“宏名”定义一个名称为:PasswordBreaker- 点击“确定”退出:第二步:再点击“宏”一“查看宏”,选择“求名”下的“PasswodBeakeL并点击“编辑" 打 开“Microsoft Visual Basic”编辑器,用如下内容替换右侧窗口中的所有代码:S

23、ub PasswordBreaker()Dim i As Integer, j As Integer, kAs IntegerDim I As Integer, mAs Integer, n As IntegerDim i1 As Integer, i2As Integer, i3 As IntegerDim i4As Integer, i5As Integer, i6 As IntegerOn Error Resume NextFor i = 65To 66: Forj = 65 To 66: For k = 65 To 66For I = 65 To 66: For m = 65 To 66: Foril =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 Tb 126ActiveSheet.Unprotect Ch

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论