工资不涨,物价在疯狂的涨!

博客园 首页 新随笔 联系 订阅 管理
 

今天下载了一个Excel2003文档,对里面的一些函数甚是感兴趣,但郁闷的是作者对文档进行了加密,有函数的地方全部设成只读属性了!在Excel的菜单中点击撤销工作表”,提示输入密码!原来如此,上网搜了一个VBA宏破解的方法,一下就成功了啊!牛人还真的多啊!不得不佩服啊,下面就说一下这个方法吧

1.  点击”→“录制宏,出现录制新宏窗口,在宏名定义一个名称为:PasswordBreaker,点击确定退出;

2.  再点击”→“查看宏,选择宏名下的“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

3.  再点击”→“查看宏,选择宏名下的“PasswordBreaker”并点击执行,密码就现形了

 

 

我是在Excel2007中打开的,根本就不需要撤销密码保护,直接就可以了啊!而且也没有撤销工作表保护的菜单。

posted on 2008-06-03 15:54  腾云驾雾  阅读(3380)  评论(0编辑  收藏  举报