excel表格加密文档的解密教程.docx
excel表格加密文档的解密教程excel表格加密文档的解密教程Excel中的加密文档有时候需要进行解密处理,但是很多人不知道怎么操作,不要着急,我告诉你excel表格加密文档的解密教程,希望浏览过后对你有所启发!excel表格加密文档解密教程加密文档解密步骤1:打开您需要破解的Excel文件,如下图:加密文档解密步骤2:依次点击菜单栏上的工具-宏-录制新宏;加密文档解密步骤3:输入宏名字(PS:打击积极性啊!)如:易尔拓,然后停止录制(这样得到一个空宏,为后面添加vb代码做准备);加密文档解密步骤4:依次点击菜单栏上的工具-宏-宏,选易尔拓,点编辑按钮;删除窗口中的所有字符,替换为下面的内容;OptionExplicitPublicSubAllInternalPasswords()Breaksworksheetandworkbookstructurepasswords.BobMcCormickprobablyoriginatorofbasecodealgorithmmodifiedforcoverageofworkbookstructure/windowspasswordsandformultiplepasswordsNormanHarkerandJEMcGimpsey27-Dec-2002(Version1.1)Modified2003-Apr-04byJEM:Allmsgstoconstants,andeliminateoneExitSub(Version1.1.1)RevealshashedpasswordsNOToriginalpasswordsConstDBLSPACEAsString=vbNewLinevbNewLineConstAUTHORSAsString=DBLSPACEvbNewLine_AdaptedfromBobMcCormickbasecodeby_NormanHarkerandJEMcGimpseyConstHEADERAsString=AllInternalPasswordsUserMessageConstVERSIONAsString=DBLSPACEVersion1.1.12003-Apr-04ConstREPBACKAsString=DBLSPACEPleasereportfailure_tothemicrosoft.public.excel.programmingnewsgroup.ConstALLCLEARAsString=DBLSPACETheworkbookshould_nowbefreeofallpasswordprotection,somakesureyou:_DBLSPACESAVEITNOW!DBLSPACEandalso_DBLSPACEBACKUP!,BACKUP!,BACKUP!_DBLSPACEAlso,rememberthatthepasswordwas_putthereforareason.Dontstuffupcrucialformulas_ordata.DBLSPACEAccessanduseofsomedata_maybeanoffense.Ifindoubt,dont.ConstMSGNOPWORDS1AsString=Therewerenopasswordson_sheets,orworkbookstructureorwindows.AUTHORSVERSIONConstMSGNOPWORDS2AsString=Therewasnoprotectionto_workbookstructureorwindows.DBLSPACE_Proceedingtounprotectsheets.AUTHORSVERSIONConstMSGTAKETIMEAsString=AfterpressingOKbuttonthis_willtakesometime.DBLSPACEAmountoftime_dependsonhowmanydifferentpasswords,the_passwords,andyourcomputersspecification.DBLSPACE_Justbepatient!Makemeacoffee!AUTHORSVERSIONConstMSGPWORDFOUND1AsString=YouhadaWorksheet_StructureorWindowsPasswordset.DBLSPACE_Thepasswordfoundwas:DBLSPACE$DBLSPACE_Noteitdownforpotentialfutureuseinotherworkbooksby_thesamepersonwhosetthispassword.DBLSPACE_Nowtocheckandclearotherpasswords.AUTHORSVERSIONConstMSGPWORDFOUND2AsString=YouhadaWorksheet_passwordset.DBLSPACEThepasswordfoundwas:_DBLSPACE$DBLSPACENoteitdownforpotential_futureuseinotherworkbooksbysamepersonwho_setthispassword.DBLSPACENowtocheckandclear_otherpasswords.AUTHORSVERSIONConstMSGONLYONEAsString=Onlystructure/windows_protectedwiththepasswordthatwasjustfound._ALLCLEARAUTHORSVERSIONREPBACKDimw1AsWorksheet,w2AsWorksheetDimiAsInteger,jAsInteger,kAsInteger,lAsIntegerDimmAsInteger,nAsInteger,i1AsInteger,i2AsIntegerDimi3AsInteger,i4AsInteger,i5AsInteger,i6AsIntegerDimPWord1AsStringDimShTagAsBoolean,WinTagAsBooleanApplication.ScreenUpdating=FalseWithActiveWorkbookWinTag=.ProtectStructureOr.ProtectWindowsEndWithShTag=FalseForEachw1InWorksheetsShTag=ShTagOrw1.ProtectContentsNextw1IfNotShTagAndNotWinTagThenMsgBoxMSGNOPWORDS1,vbInformation,HEADERExitSubEndIfMsgBoxMSGTAKETIME,vbInformation,HEADERIfNotWinTagThenMsgBoxMSGNOPWORDS2,vbInformation,HEADERElseOnErrorResumeNextDodummydoloopFori=65To66:Forj=65To66:Fork=65To66Forl=65To66:Form=65To66:Fori1=65To66Fori2=65To66:Fori3=65To66:Fori4=65To66Fori5=65To66:Fori6=65To66:Forn=32To126WithActiveWorkbook.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=FalseThenPWord1=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,HEADERExitDoBypassallfor.nextsEndIfEndWithNext:Next:Next:Next:Next:NextNext:Next:Next:Next:Next:NextLoopUntilTrueOnErrorGoTo0EndIfIfWinTagAndNotShTagThenMsgBoxMSGONLYONE,vbInformation,HEADERExitSubEndIfOnErrorResumeNextForEachw1InWorksheetsAttemptclearancewithPWord1w1.UnprotectPWord1Nextw1OnErrorGoTo0ShTag=FalseForEachw1InWorksheetsChecksforallclearShTagtriggeredto1ifnot.ShTag=ShTagOrw1.ProtectContentsNextw1IfShTagThenForEachw1InWorksheetsWithw1If.ProtectContentsThenOnErrorResumeNextDoDummydoloopFori=65To66:Forj=65To66:Fork=65To66Forl=65To66:Form=65To66:Fori1=65To66Fori2=65To66:Fori3=65To66:Fori4=65To66Fori5=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.ProtectContentsThenPWord1=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,HEADERleveragefindingPwordbytryingonothersheetsForEachw2InWorksheetsw2.UnprotectPWord1Nextw2ExitDoBypassallfor.nextsEndIfNext:Next:Next:Next:Next:NextNext:Next:Next:Next:Next:NextLoopUntilTrueOnErrorGoTo0EndIfEndWithNextw1EndIfMsgBoxALLCLEARAUTHORSVERSIONREPBACK,vbInformation,HEADEREndSub加密文档解密步骤5:依次点击菜单栏上的工具-宏-宏,选AllInternalPasswords,执行,确定两次;耐心等一会,再点击两次确定,就ok啦!