每天學習一個小技巧,堅持下去你也能成為大神!
在平常的工作中,為了防止別人修改自己的Excel工作表,我們經常會給工作表添加保護密碼。
但如果有一天,我們的密碼忘了該怎么辦呢?今天就教大家如何快速破解Excel工作表保護密碼,只需要簡單的幾步,就可以破解了。
操作步驟:
第一步:把Excel文件的后綴名xlsx修改為Rar,這時候Excel文件就變成了壓縮包的形式。
如果電腦沒有顯示文件的后綴名,那就如下圖所示,打開【我的電腦】,然后找到【查看】按鈕,在右邊有一個【顯示文件擴展名】,將它勾選上。
第二步:雙擊打開壓縮包,在【xl】文件夾 —【worksheets】文件夾里找到【sheet1.xml】工作表,把它拖動復制出來。
第三步:用記事本打開sheet1.xml文件,按【Ctrl+F】打開查找對話框,在查找內容里輸入"protect”。
查找后我們再把這個單詞所在的<>里面的所有內容刪除,刪除后保存改文件。
第四步:將保存后的文件重新拖回壓縮包中。
第五步:重新把后輟名由rar改回xlsx
這時候再打開excel文件,會發現工作表已經不需要密碼就可以修改編輯了。
以上就是今天給大家介紹的破解Excel工作表密碼保護的方法,如果覺得有幫助的話,趕緊收藏轉發吧!
小編今天給大家“喜加壹”的是一個小破解技術,在辦公中還是很常用的,有興趣的繼續往下看(文章截圖很詳
工作中經常遇到上級或者別人發來的Excel模板文件,用保護工作表的方式鎖定了,如下:
保護后如果你想編輯會出現如下提示:
那就很討厭了,當然很多鎖定的Excel用復制粘貼的方法重新建一個也可以,如果保護的權限更多些,甚至不給復制,真是太討厭了。小編這里介紹一個破解的方法,請看下面:
1、點擊錄制新宏,宏名隨便取一個,但是自己要記得,我這取“破解保護”,點擊確定。
然后直接停止錄制
點擊左邊的按鈕“宏”,選擇編輯
進入如下VB腳本編輯界面,刪除紅色方框里的內容,復制文章最后給的腳本進去。
復制腳本進去后,如下圖:
點擊上面的執行按鈕,如下圖:
運行時出現如下界面,都請點擊確定:
回到如下腳本界面,
點右上角關閉這個界面,回到Excel界面,發現保護撤銷了,可以輸入文字了:
成功破解保護!
覺得實用的給小編一個贊,關注一波。
【喜加壹】每天為您帶來小福利小便捷。
腳本如下,復制的時候一個字符都不要丟:
Public Sub AllInternalPasswords()
' Breaks worksheet and workbook structure passwords. Bob McCormick
' probably originator of base code algorithm modified for coverage
' of workbook structure / windows passwords and for multiple passwords
'
' Norman Harker and JE McGimpsey 27-Dec-2002 (Version 1.1)
' Modified 2003-Apr-04 by JEM: All msgs to constants, and
' eliminate one Exit Sub (Version 1.1.1)
' Reveals hashed passwords NOT original passwords
Const DBLSPACE As String=vbNewLine & vbNewLine
Const AUTHORS As String=DBLSPACE & vbNewLine & _
"Adapted from Bob McCormick base code by" & _
"Norman Harker and JE McGimpsey"
Const HEADER As String="AllInternalPasswords User Message"
Const VERSION As String=DBLSPACE & "Version 1.1.1 2003-Apr-04"
Const REPBACK As String=DBLSPACE & "Please report failure " & _
"to the microsoft.public.excel.programming newsgroup."
Const ALLCLEAR As String=DBLSPACE & "The workbook should " & _
"now be free of all password protection, so make sure you:" & _
DBLSPACE & "SAVE IT NOW!" & DBLSPACE & "and also" & _
DBLSPACE & "BACKUP!, BACKUP!!, BACKUP!!!" & _
DBLSPACE & "Also, remember that the password was " & _
"put there for a reason. Don't stuff up crucial formulas " & _
"or data." & DBLSPACE & "Access and use of some data " & _
"may be an offense. If in doubt, don't."
Const MSGNOPWORDS1 As String="There were no passwords on " & _
"sheets, or workbook structure or windows." & AUTHORS & VERSION
Const MSGNOPWORDS2 As String="There was no protection to " & _
"workbook structure or windows." & DBLSPACE & _
"Proceeding to unprotect sheets." & AUTHORS & VERSION
Const MSGTAKETIME As String="After pressing OK button this " & _
"will take some time." & DBLSPACE & "Amount of time " & _
"depends on how many different passwords, the " & _
"passwords, and your computer's specification." & DBLSPACE & _
"Just be patient! Make me a coffee!" & AUTHORS & VERSION
Const MSGPWORDFOUND1 As String="You had a Worksheet " & _
"Structure or Windows Password set." & DBLSPACE & _
"The password found was: " & DBLSPACE & "$$" & DBLSPACE & _
"Note it down for potential future use in other workbooks by " & _
"the same person who set this password." & DBLSPACE & _
"Now to check and clear other passwords." & AUTHORS & VERSION
Const MSGPWORDFOUND2 As String="You had a Worksheet " & _
"password set." & DBLSPACE & "The password found was: " & _
DBLSPACE & "$$" & DBLSPACE & "Note it down for potential " & _
"future use in other workbooks by same person who " & _
"set this password." & DBLSPACE & "Now to check and clear " & _
"other passwords." & AUTHORS & VERSION
Const MSGONLYONE As String="Only structure / windows " & _
"protected with the password that was just found." & _
ALLCLEAR & AUTHORS & VERSION & REPBACK
Dim w1 As Worksheet, w2 As Worksheet
Dim i As Integer, j As Integer, k As Integer, l As Integer
Dim m As Integer, n As Integer, i1 As Integer, i2 As Integer
Dim i3 As Integer, i4 As Integer, i5 As Integer, i6 As Integer
Dim PWord1 As String
Dim ShTag As Boolean, WinTag As Boolean
Application.ScreenUpdating=False
With ActiveWorkbook
WinTag=.ProtectStructure Or .ProtectWindows
End With
ShTag=False
For Each w1 In Worksheets
ShTag=ShTag Or w1.ProtectContents
Next w1
If Not ShTag And Not WinTag Then
MsgBox MSGNOPWORDS1, vbInformation, HEADER
Exit Sub
End If
MsgBox MSGTAKETIME, vbInformation, HEADER
If Not WinTag Then
MsgBox MSGNOPWORDS2, vbInformation, HEADER
Else
On Error Resume Next
Do 'dummy do loop
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
With ActiveWorkbook
.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 .ProtectStructure=False And _
.ProtectWindows=False Then
PWord1=Chr(i) & Chr(j) & Chr(k) & Chr(l) & _
Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _
Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
MsgBox Application.Substitute(MSGPWORDFOUND1, _
"$$", PWord1), vbInformation, HEADER
Exit Do 'Bypass all for...nexts
End If
End With
Next: Next: Next: Next: Next: Next
Next: Next: Next: Next: Next: Next
Loop Until True
On Error GoTo 0
End If
If WinTag And Not ShTag Then
MsgBox MSGONLYONE, vbInformation, HEADER
Exit Sub
End If
On Error Resume Next
For Each w1 In Worksheets
'Attempt clearance with PWord1
w1.Unprotect PWord1
Next w1
On Error GoTo 0
ShTag=False
For Each w1 In Worksheets
'Checks for all clear ShTag triggered to 1 if not.
ShTag=ShTag Or w1.ProtectContents
Next w1
If ShTag Then
For Each w1 In Worksheets
With w1
If .ProtectContents Then
On Error Resume Next
Do 'Dummy do loop
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
.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 Not .ProtectContents Then
PWord1=Chr(i) & Chr(j) & Chr(k) & Chr(l) & _
Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _
Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
MsgBox Application.Substitute(MSGPWORDFOUND2, _
"$$", PWord1), vbInformation, HEADER
'leverage finding Pword by trying on other sheets
For Each w2 In Worksheets
w2.Unprotect PWord1
Next w2
Exit Do 'Bypass all for...nexts
End If
Next: Next: Next: Next: Next: Next
Next: Next: Next: Next: Next: Next
Loop Until True
On Error GoTo 0
End If
End With
Next w1
End If
MsgBox ALLCLEAR & AUTHORS & VERSION & REPBACK, vbInformation, HEADER
End Sub