电脑破解excel工作表密码的方法

如题所述


excel是办公软件Microsoftoffice的组件之一,win7正式版系统电脑在工作中使用excel工作表的时候,一些重要的文件我们都会给它设置上密码。但是时间久了,容易把密码忘记了,那么有什么办法可以破解excel工作表密码呢?接下去我们一起分享电脑破解excel工作表密码的方法。
具体方法如下:
1、打开excel工作表;
2、然后在Excel表中找到【视图】;
3、点开【宏】;
4、然后选择【录制宏】;
5、接着会弹出一个窗口,点击【确定】;
6、在此点开【宏】,点击【停止录制】;
7、然后再点击【宏】,弹出窗口点击【编辑】;
8、然后点击【模板1】,并清空右边红框里的代码;
9、然后把破解代码复制粘贴进入空白处;
10、然后在打开【查看宏】,点击执行破解代码;
11、会弹出一个框,是英文的,看不懂没关系,点击确定,解密需要一段时间;
破解代码:
PublicSubAllInternalPasswords()
'Breaksworksheetandworkbookstructurepasswords.BobMcCormick
'probablyoriginatorofbasecodealgorithmmodifiedforcoverage
'ofworkbookstructure/windowspasswordsandformultiplepasswords
'NormanHarkerandJEMcGimpsey27-Dec-2002(Version1.1)
'Modified2003-Apr-04byJEM:Allmsgstoconstants,and
'eliminateoneExitSub(Version1.1.1)
'RevealshashedpasswordsNOToriginalpasswords
ConstDBLSPACEAsString=vbNewLinevbNewLine
ConstAUTHORSAsString=DBLSPACEvbNewLine_
"AdaptedfromBobMcCormickbasecodeby"_
"NormanHarkerandJEMcGimpsey"
ConstHEADERAsString="AllInternalPasswordsUserMessage"
ConstVERSIONAsString=DBLSPACE"Version1.1.12003-Apr-04"
ConstREPBACKAsString=DBLSPACE"Pleasereportfailure"_
"tothemicrosoft.public.excel.programmingnewsgroup."
ConstALLCLEARAsString=DBLSPACE"Theworkbookshould"_
"nowbefreeofallpasswordprotection,somakesureyou:"_
DBLSPACE"SAVEITNOW!"DBLSPACE"andalso"_
DBLSPACE"BACKUP!,BACKUP!!,BACKUP!!!"_
DBLSPACE"Also,rememberthatthepasswordwas"_
"putthereforareason.Don'tstuffupcrucialformulas"_
"ordata."DBLSPACE"Accessanduseofsomedata"_
"maybeanoffense.Ifindoubt,don't."
ConstMSGNOPWORDS1AsString="Therewerenopasswordson"_
"sheets,orworkbookstructureorwindows."AUTHORSVERSION
ConstMSGNOPWORDS2AsString="Therewasnoprotectionto"_
"workbookstructureorwindows."DBLSPACE_
"Proceedingtounprotectsheets."AUTHORSVERSION
ConstMSGTAKETIMEAsString="AfterpressingOKbuttonthis"_
"willtakesometime."DBLSPACE"Amountoftime"_
"dependsonhowmanydifferentpasswords,the"_
"passwords,andyourcomputer'sspecification."DBLSPACE_
"Justbepatient!Makemeacoffee!"AUTHORSVERSION
ConstMSGPWORDFOUND1AsString="YouhadaWorksheet"_
"StructureorWindowsPasswordset."DBLSPACE_
"Thepasswordfoundwas:"DBLSPACE""DBLSPACE_
"Noteitdownforpotentialfutureuseinotherworkbooksby"_
"thesamepersonwhosetthispassword."DBLSPACE_
"Nowtocheckandclearotherpasswords."AUTHORSVERSION
ConstMSGPWORDFOUND2AsString="YouhadaWorksheet"_
"passwordset."DBLSPACE"Thepasswordfoundwas:"_
DBLSPACE""DBLSPACE"Noteitdownforpotential"_
"futureuseinotherworkbooksbysamepersonwho"_
"setthispassword."DBLSPACE"Nowtocheckandclear"_
"otherpasswords."AUTHORSVERSION
ConstMSGONLYONEAsString="Onlystructure/windows"_
"protectedwiththepasswordthatwasjustfound."_
ALLCLEARAUTHORSVERSIONREPBACK
Dimw1AsWorksheet,w2AsWorksheet
DimiAsInteger,jAsInteger,kAsInteger,lAsInteger
DimmAsInteger,nAsInteger,i1AsInteger,i2AsInteger
Dimi3AsInteger,i4AsInteger,i5AsInteger,i6AsInteger
DimPWord1AsString
DimShTagAsBoolean,WinTagAsBoolean
Application.ScreenUpdating=False
WithActiveWorkbook
WinTag=.ProtectStructureOr.ProtectWindows
EndWith
ShTag=False
ForEachw1InWorksheets
ShTag=ShTagOrw1.ProtectContents
Nextw1
IfNotShTagAndNotWinTagThen
MsgBoxMSGNOPWORDS1,vbInformation,HEADER
ExitSub
EndIf
MsgBoxMSGTAKETIME,vbInformation,HEADER
IfNotWinTagThen
MsgBoxMSGNOPWORDS2,vbInformation,HEADER
Else
OnErrorResumeNext
Do'dummydoloop
Fori=65To66:Forj=65To66:Fork=65To66
Forl=65To66:Form=65To66:Fori1=65To66
Fori2=65To66:Fori3=65To66:Fori4=65To66
Fori5=65To66:Fori6=65To66:Forn=32To126
WithActiveWorkbook
.UnprotectChr(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=FalseAnd_
.ProtectWindows=FalseThen
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)
MsgBoxApplication.Substitute(MSGPWORDFOUND1,_
"",PWord1),vbInformation,HEADER
ExitDo'Bypassallfor...nexts
EndIf
EndWith
Next:Next:Next:Next:Next:Next
Next:Next:Next:Next:Next:Next
LoopUntilTrue
OnErrorGoTo0
EndIf
IfWinTagAndNotShTagThen
MsgBoxMSGONLYONE,vbInformation,HEADER
ExitSub
EndIf
OnErrorResumeNext
ForEachw1InWorksheets
'AttemptclearancewithPWord1
w1.UnprotectPWord1
Nextw1
OnErrorGoTo0
ShTag=False
ForEachw1InWorksheets
'ChecksforallclearShTagtriggeredto1ifnot.
ShTag=ShTagOrw1.ProtectContents
Nextw1
IfShTagThen
ForEachw1InWorksheets
Withw1
If.ProtectContentsThen
OnErrorResumeNext
Do'Dummydoloop
Fori=65To66:Forj=65To66:Fork=65To66
Forl=65To66:Form=65To66:Fori1=65To66
Fori2=65To66:Fori3=65To66:Fori4=65To66
Fori5=65To66:Fori6=65To66:Forn=32To126
.UnprotectChr(i)Chr(j)Chr(k)_
Chr(l)Chr(m)Chr(i1)Chr(i2)Chr(i3)_
Chr(i4)Chr(i5)Chr(i6)Chr(n)
IfNot.ProtectContentsThen
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)
MsgBoxApplication.Substitute(MSGPWORDFOUND2,_
"",PWord1),vbInformation,HEADER
'leveragefindingPwordbytryingonothersheets
ForEachw2InWorksheets
w2.UnprotectPWord1
Nextw2
ExitDo'Bypassallfor...nexts
EndIf
Next:Next:Next:Next:Next:Next
Next:Next:Next:Next:Next:Next
LoopUntilTrue
OnErrorGoTo0
EndIf
EndWith
Nextw1
EndIf
MsgBoxALLCLEARAUTHORSVERSIONREPBACK,vbInformation,HEADER
EndSub
上述就是电脑破解excel工作表密码的方法,希望此教程内容能够帮助到大家。
温馨提示:答案为网友推荐,仅供参考
相似回答
大家正在搜