报告老师,撸完。不够完善,需要再对保护状态有更明确的显示。
[attach]53174[/attach]
[attach]53175[/attach] 作者: /kuk心如止水 时间: 2014-2-26 14:46
Sub RemoveShProtect()
Dim i1 As Integer, i2 As Integer, i3 As Integer
Dim i4 As Integer, i5 As Integer, i6 As Integer
Dim i7 As Integer, i8 As Integer, i9 As Integer
Dim i10 As Integer, i11 As Integer, i12 As Integer
On Error Resume Next
If ActiveSheet.ProtectContents = False Then
MsgBox "该工作表没有保护密码!"
Exit Sub
End If
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 i7 = 65 To 66: For i8 = 65 To 66: For i9 = 65 To 66
For i10 = 65 To 66: For i11 = 65 To 66: For i12 = 32 To 126
ActiveSheet.Unprotect Chr(i1) & Chr(i2) & Chr(i3) & Chr(i4) & Chr(i5) _
& Chr(i6) & Chr(i7) & Chr(i8) & Chr(i9) & Chr(i10) & Chr(i11) & Chr(i12)
If ActiveSheet.ProtectContents = False Then
MsgBox "已经解除了工作表保护!"
Exit Sub
End If
Next: Next: Next: Next: Next: Next
Next: Next: Next: Next: Next: Next
End Sub
Sub RemoveBkProtect()
Dim i1 As Integer, i2 As Integer, i3 As Integer
Dim i4 As Integer, i5 As Integer, i6 As Integer
Dim i7 As Integer, i8 As Integer, i9 As Integer
Dim i10 As Integer, i11 As Integer, i12 As Integer
On Error Resume Next
If ActiveWorkbook.ProtectStructure = False And ActiveWorkbook.ProtectWindows = False Then
MsgBox "该工作簿没有保护密码!"
Exit Sub
End If
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 i7 = 65 To 66: For i8 = 65 To 66: For i9 = 65 To 66
For i10 = 65 To 66: For i11 = 65 To 66: For i12 = 32 To 126
ActiveWorkbook.Unprotect Chr(i1) & Chr(i2) & Chr(i3) & Chr(i4) & Chr(i5) _
& Chr(i6) & Chr(i7) & Chr(i8) & Chr(i9) & Chr(i10) & Chr(i11) & Chr(i12)
If ActiveWorkbook.ProtectStructure = False And ActiveWorkbook.ProtectWindows = False Then
MsgBox "已经解除了工作簿保护!"
Exit Sub
End If
Next: Next: Next: Next: Next: Next
Next: Next: Next: Next: Next: Next
End Sub作者: /kuk心如止水 时间: 2014-2-26 14:47
看看这个能用不作者: 伊邪那美 时间: 2014-2-27 10:36
可以,这个代码可以得到密码。不过多个密文密匙相通,不一定是原始密匙 作者: 刘苏 时间: 2014-3-11 20:25
真厉害~~ 秒杀作者: yjjcm 时间: 2014-3-26 20:56
没试过,运行一下实施