




版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、Excel工作表保護(hù)密碼清除1,打開需要解除保護(hù)的EXCEL工作表;2,選擇工具-宏-錄制新宏-輸入名字如:aa;3,停止錄制(這樣得到一個(gè)空宏);4,工具-宏-宏,選aa,點(diǎn)編輯按鈕;5,刪除窗口中的所有字符(只有幾個(gè)),替換為下面的內(nèi)容:(復(fù)制吧);6,關(guān)閉編輯窗口;7,工具-宏-宏,選AllInternalPasswords,運(yùn)行,確定兩次,等2分鐘,再確定.OK,舊的密碼自動(dòng)提示,工作表也自動(dòng)解除保護(hù)了。 內(nèi)容如下:=Public Sub AllInternalPasswords() ' Breaks worksheet and workbo
2、ok 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
3、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 H
4、arker 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.p
5、rogramming 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 & "
6、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
7、 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 struc
8、ture 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 " & _ "depen
9、ds 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 " & _ "Struc
10、ture 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
11、 & _ "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 &
12、amp; "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 Stri
13、ng = "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, i
14、1 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 BooleanApplication.ScreenUpdating = False With ActiveWorkbook WinTag = .ProtectStructure Or .ProtectWindows End With ShTag = False For Each w1 In Worksheets
15、 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
16、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)
17、& 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
18、(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 N
19、ot 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 =
20、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
21、 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)
22、& 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
23、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
24、 Sub=Excel表格密碼保護(hù)的解除方法表格受密碼保護(hù)時(shí),我們修改數(shù)據(jù)Excel彈出“您試圖更改的單元格或圖表受保護(hù),因而是只讀的。若要修改受保護(hù)單元格或圖表,請(qǐng)先使用撤消工作表保護(hù)命令(在審閱選項(xiàng)卡的更改組中)來(lái)取消保護(hù)??赡軙?huì)提示您輸入密碼。這時(shí)候我們可以用VBA宏代碼破解法來(lái)破解表格保護(hù)密碼:第一步:打開該文件,先解除默認(rèn)的“宏禁用”狀態(tài),方法是點(diǎn)擊工具欄下的“選項(xiàng)”狀態(tài)按鈕,打開“Microsoft Office安全選項(xiàng)”窗口,選擇其中的“啟用此內(nèi)容”,“確定”。再切換到“視圖”選項(xiàng)卡,點(diǎn)擊“宏”“錄制宏”,出現(xiàn)“錄制新宏”窗口,在“宏名”定義一個(gè)名稱為:PasswordBreake
25、r,點(diǎn)擊“確定”退出;第二步:再點(diǎn)擊“宏”“查看宏”,選擇“宏名”下的“PasswordBreaker”并點(diǎn)擊“編輯”,打開“Microsoft Visual Basic”編輯器,用如下內(nèi)容替換右側(cè)窗口中的所有代碼:Sub PasswordBreaker()Dim i As Integer, j As Integer, k As IntegerDim l As Integer, m As Integer, n As IntegerDim i1 As Integer, i2 As Integer, i3 As IntegerDim i4 As Integer, i5 As Integer, i6 As IntegerOn Error Resume NextFor i = 65 To 66: For j = 65 To 66: For k = 65 To 66For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66For i5 = 65 To 66: For
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 四川省威遠(yuǎn)縣龍會(huì)中學(xué)2025屆高考考前模擬考試化學(xué)試題文試題含解析
- 天津市濱海新區(qū)大港油田一中2025年高三下學(xué)期期末考試(第四次月考)數(shù)學(xué)試題含解析
- 浙江省杭州市臨安區(qū)、富陽(yáng)區(qū)2025年初三第一次診斷考試物理試題文試題含解析
- 四川省什邡市城南校2025年初三年級(jí)第三次畢業(yè)診斷及模擬測(cè)試英語(yǔ)試題試卷含答案
- 四川省南充市儀隴縣重點(diǎn)中學(xué)2024-2025學(xué)年初三下學(xué)期第三次質(zhì)量檢查化學(xué)試題含解析
- 2023-2024學(xué)年遼寧大石橋初二上期期末檢測(cè)物理卷【含答案】
- 房地產(chǎn)買賣合同常見問(wèn)題解答
- 感冒中醫(yī)治療課件
- 1人要自強(qiáng) 議題式公開課一等獎(jiǎng)創(chuàng)新教學(xué)設(shè)計(jì)-統(tǒng)編版道德與法治七年級(jí)下冊(cè)
- Brand KPIs for ready-made-food Gino D'Acampo in the United Kingdom-外文版培訓(xùn)課件(2025.2)
- 2024年甘肅水投集團(tuán)遴選引洮供水公司招聘筆試參考題庫(kù)含答案解析
- 腸癌篩查早發(fā)現(xiàn)早治療
- 醫(yī)療器械經(jīng)營(yíng)安全培訓(xùn)必備知識(shí)
- 網(wǎng)格員宣傳防詐騙知識(shí)講座
- (完整文本版)新概念英語(yǔ)第一冊(cè)單詞表默寫版1-144
- 《醫(yī)院勞動(dòng)合同書》電子版
- 機(jī)車直流電機(jī)的電力拖動(dòng)-直流電機(jī)的基本方程
- 2022-2023學(xué)年四川省巴中市巴州區(qū)川教版(三起)四年級(jí)下學(xué)期4月期中英語(yǔ)試卷(解析版)
- 互聯(lián)網(wǎng)信息審核員考試題庫(kù)大全-上(單選題匯總)
- 湖南省長(zhǎng)沙市實(shí)驗(yàn)小學(xué)小學(xué)語(yǔ)文五年級(jí)下冊(cè)期末試卷(含答案)
- 硫酸生產(chǎn)技術(shù) 二氧化硫催化氧化的化學(xué)平衡及動(dòng)力學(xué)
評(píng)論
0/150
提交評(píng)論