2009年6月2日 星期二

破解Excel 保護工作表 的密碼

破解Excel 保護工作表 的密碼 (摘自vba.blogspot.com)
以下VBA可以查出[保護工作表]的密碼.
此為4位數的[英數密碼], 可自行修改以符合自己的需求.
Sub JackyCP()
Dim DimArr(63)
Dim PW As String
For x = 48 To 57
xx = xx + 1
DimArr(xx) = Chr(x)
Next
For x = 97 To 122
xx = xx + 1
DimArr(xx) = Chr(x)
NextFor x = 65 To 90
xx = xx + 1
DimArr(xx) = Chr(x)Next
On Error Resume Next
For x1 = 1 To UBound(DimArr) - 1
For x2 = 1 To UBound(DimArr) - 1
For x3 = 1 To UBound(DimArr) - 1
For x4 = 1 To UBound(DimArr) - 1
PW = DimArr(x1) & DimArr(x2) & DimArr(x3) & DimArr(x4)
Application.StatusBar = PW
ActiveSheet.Unprotect PW
If ActiveSheet.ProtectContents = False Then
MsgBox "Password is " & PW
Exit Sub
End If
Next
Next
Next
Next
End Sub

2 則留言:

Benny666 提到...
作者已經移除這則留言。
Benny666 提到...

您好:
無意間搜尋到您這篇文章,我有程式相關問題想請您協助,邀請您與我聯繫與討論,可藉由電郵進一步留下電話,謝謝您!sir1688@msn.com

revit 小住宅練習

revit 小住宅練習 專案零件檔下載