懂視移動端 視頻1 視頻21 視頻41 視頻61 視頻文章1 視頻文章21 視頻文章41 視頻文章61 推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37 推薦39 推薦41 推薦43 推薦45 推薦47 推薦49 關鍵詞1 關鍵詞101 關鍵詞201 關鍵詞301 關鍵詞401 關鍵詞501 關鍵詞601 關鍵詞701 關鍵詞801 關鍵詞901 關鍵詞1001 關鍵詞1101 關鍵詞1201 關鍵詞1301 關鍵詞1401 關鍵詞1501 關鍵詞1601 關鍵詞1701 關鍵詞1801 關鍵詞1901 視頻擴展1 視頻擴展6 視頻擴展11 視頻擴展16 文章1 文章201 文章401 文章601 文章801 文章1001 資訊1 資訊501 資訊1001 資訊1501 標簽1 標簽501 標簽1001 關鍵詞1 關鍵詞501 關鍵詞1001 關鍵詞1501
問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
當前位置: 首頁 - 手機 - 正文

office中excel“撤銷保護密碼”的方法很有效

來源:懂視網(wǎng) 責編:小OO 時間:2020-03-19 16:28:43
導讀工作中,有時會出現(xiàn)這樣的情況:用Excel編制的報表、表格、程序等,在單元格中設置了公式、函數(shù)等,為了防止其他人修改您的設置或者防止您自己無意中修改,您可能會使用Excel的工作表保護功能,但時間久了保護密碼容易忘記,有時從網(wǎng)上下載的Excel格式的小程序,想修改,但是作者加了工作表保護密碼,下面就拉看看office中excel“撤銷保護密碼”的方法吧!材料/工具Excel(以Excel2010為例)方法雙擊打開需要破解保護密碼的Excel文件依次點擊菜單欄上的視圖---宏----錄制宏輸入宏名...
工作中,有時會出現(xiàn)這樣的情況:用Excel編制的報表、表格、程序等,在單元格中設置了公式、函數(shù)等,為了防止其他人修改您的設置或者防止您自己無意中修改,您可能會使用Excel的工作表保護功能,但時間久了保護密碼容易忘記,有時從網(wǎng)上下載的Excel格式的小程序,想修改,但是作者加了工作表保護密碼,下面就拉看看office中excel“撤銷保護密碼”的方法吧!

材料/工具

Excel(以Excel2010為例)

方法

雙擊打開需要破解保護密碼的Excel文件

依次點擊菜單欄上的視圖---宏----錄制宏

輸入宏名字如:宏1點擊確定

依次點擊菜單欄上的視圖---宏----停止錄制

依次點擊菜單欄上的視圖---宏----查看宏

選擇宏1點擊編輯

將窗口內的內容全選后刪除

然后將下面分割線以內的內容開始復制粘貼在上面的窗口內:
從橫線下開始復制
------------------------------------------------------------------------------------------
Option Explicit

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
-----------------------------------------------------------------------------------------
復制到橫線以上

得到情況如下圖表示

關閉編輯窗口

依次點擊菜單欄上的視圖---宏-----查看宏

選AllInternalPasswords,執(zhí)行

確定三次,這是第三次的確定圖

撤銷成功

最后記得關閉EXCEL文檔時要保存,否則下回打開,文檔仍舊處于只讀狀態(tài)而無法修改。點擊保存

點擊是

聲明:本網(wǎng)頁內容旨在傳播知識,若有侵權等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

  • 熱門焦點

最新推薦

猜你喜歡

熱門推薦

怎么自動關機,命令的啟動和取消 銀行卡該如何開通短信提醒 excel打不開時如何修復處理 如何用筆記本攝像頭拍照 怎么在不改變圖片清晰度的情況下減小存儲大小 ps怎么添加和去除網(wǎng)格線 怎樣用origin繪圖軟件繪制對數(shù)坐標圖 word頁面設置里沒有A3紙格式怎么辦 如何制作二維碼鏈接 PPT都有哪些幻燈片放映快捷鍵 win7開啟超級管理員賬戶(Administrator) word中該如何為文字添加注釋 迅雷下載資源不足如何處理 ie瀏覽器怎樣設置打開網(wǎng)頁的方式 聯(lián)想g50怎么進入bios 買電腦需要注意哪些配置 如何恢復ie默認的設置 電腦無法開機,一直不停重啟怎么辦 論文怎么查重復率 軟件問題導致AutoCAD意外關閉 cad如何保存為pdf 如何在excel表格中固定第一行 通過路由器查看寬帶密碼 while循環(huán)語句 怎么修改支付寶賬戶名 快捷鍵選擇EXCEL一行或一列 iPhone蘋果手機突然黑屏開不了機怎么辦 用電腦免費給手機發(fā)短信 什么是花唄——支付寶新功能 用電腦怎樣下載微信5.0版到手機 如何重裝聲卡驅動 微信公眾號如何發(fā)文章 Excel函數(shù)詳解:TRUE和FALSE函數(shù)用法 蘋果6如何還原出廠設置 如何恢復已經(jīng)退出的qq群 怎么把pdf中的圖像全部導出 電腦打開網(wǎng)頁慢的原因及解決辦法 win10打印機共享如何設置 怎么在一張ppt中插入多張圖片并能依次播放 傳真機的使用方法
Top