今天拿到個EXCEL表格,想看看公式是怎樣,卻被上鎖了,咋辦咋辦?
除了黃色區域,其他都不能修改,不能看公式
當然得解鎖,找出密碼來!
祭出編程大法。
首先設置,許可運行宏:
得有權限
然後點擊
VBS
打開VB腳本編輯器,粘貼上這些代碼:
代碼在文末
點擊運行按鈕:
結果很快呈現:
is後這一串就是密碼
可以用此密碼,解鎖文件,其實文件在現在狀态已經能夠編輯或查看前面鎖定的部分了。
解鎖表單
輸入前面獲得密碼
怎麼樣?簡單吧!
文本代碼如下:
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
,更多精彩资讯请关注tft每日頭條,我们将持续为您更新最新资讯!