Excel表格密码保护的解除方法
关键字:office2003 office2007 宏 密码保护

表格受密码保护时,我们修改数据Excel弹出您试图更改的单元格或图表受保护,因而是只读的。若要修改受保护单元格或图表,请先使用撤消工作表保 命令(审阅选项卡的更改组中)来取消保护。可能会提示您输入密码。这时候我们可以用VBA宏代码破解法来破解表格保护密码:

 

第一步:

Office2003打开该文件,先解除默认的宏禁用状态,方法是点击工具栏下的选项状态按钮,打开“Microsoft Office安全选项窗口,选择其中的启用此内容确定。再切换到视图选项卡,点击”→“录制宏,出现录制新宏窗口,在宏名定义一个名称为:PasswordBreaker,点击确定退出;

Office2007默认是不显示开发工具栏的,在excel窗口最顶端右键点击“custome quick access tool<自定义快捷工具栏>”---》在新窗口中点击“Popular<常用>”---》选择右侧的“show developer tab in the ribbon”,确定;在新出现的developer工具栏,点击“macro security ”,然后选择新窗体中的“enable all macros (not recommands...)”

第二步:再点击”→“查看宏,选择宏名下的 “PasswordBreaker”并点击编辑,打开“Microsoft Visual Basic”编辑器,用如下内容替换右侧窗口中的所有代码:
Sub PasswordBreaker()
  
Dim i As Integer, j As Integer, k As Integer
  
Dim l As Integer, m As Integer, n As Integer
  
Dim i1 As Integer, i2 As Integer, i3 As Integer
  
Dim i4 As Integer, i5 As Integer, i6 As Integer
  
On Error Resume Next
  
For i = 65 To 66: For j = 65 To 66: For k = 65 To 66
  
For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66
  
For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66
  
For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126
  
ActiveSheet.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 ActiveSheet.ProtectContents = False Then
  
MsgBox "One usable password is " &_chr(i) &_chr(j) & _
  
Chr(k) &_chr(l) &_chr(m) &_chr(i1) &_chr(i2) & _
  
Chr(i3) &_chr(i4) &_chr(i5) &_chr(i6) &_chr(n)
  
ActiveWorkbook.Sheets(1).Select
  
Range("a1").FormulaR1C1 =_chr(i) &_chr(j) & _
  
Chr(k) &_chr(l) &_chr(m) &_chr(i1) &_chr(i2) & _
  
Chr(i3) &_chr(i4) &_chr(i5) &_chr(i6) &_chr(n)
  
Exit Sub
  
End If
  
Next: Next: Next: Next: Next: Next
  
Next: Next: Next: Next: Next: Next
  
End Sub

 

第三步:再点击”→“查看宏,选择宏名下的“PasswordBreaker”并点击执行,密码就现形了
第四步:点击撤消工作表保护,然后输入密码即可解除锁定;
测试结果,密码破解可用,但是很晕的是破解的密码跟原来的密码有很大的差距,想不明白了,反正能用就好。