用户名:一起学习好快乐
我就用我自己的加密的excel文件叫大家怎么****excel密码,首先打开有自己加密的excel文档,如下图:
excel2010和以前的版本有所不同,功能更人性化,更智能化。首先我们要做的是,加载宏文件,excel来自为宏设置默认守闭的,我们要启用宏,就必须开启宏;“文件”下的子菜单”选项“
如下图所示:
点击“选项”选择子菜单下“个势需第南散植海信任中心”“宏设置”在宏设置下。选择“启用所以宏”然后点击“确定”
如下图所示:
点击“视图”在右下面我们问答会看“宏”打开宏,如下图所示:
现在我们就开始录制新宏,宏名:随便填,我这么久填密求药行快希背坚码,保存在:选择当前工作薄,说明可以不填。
如下图所示:
我们在宏工作薄中,把一下宏程序写进去。
OptionExplicit
PublicSubAllInternalPasswords()'Bre**sworksheetandworkbookstructurepasswords.BobMcCormick'probablyori游块井劳队国ginatorofbase女题读空里codealgorithmmodifiedforcoverage'ofworkbookstructure/windowspasswordsandformultiplepass占整words''No的掌rmanh**arke影模说企曲危年呢randJEMcGimpsey27-Dec-2002(Version1.1)'Modified2003-Apr-04byJEM:Allmsgstoconstants,and'eliminateoneExitSub(Version1慢呀商气.1.1)'Rev困影时绝责齐断挥ealshashed前树passwordsNOToriginalpasswordsConstDBLSPACEAsString=vbNewL复判仅但响把守宽ine&vbNewLineConstAUTh**讨搞ORSAsString=DBLSPACE&vbNewLine&_"AdaptedfromBobMcCormickbasecodeby"&_"Normanh**ar钢币脸斗给kerandJEMcGimpsey"Consth**EADERAsString="AllInte刑找门界鲁树段空与沙感rnalPasswordsU升扬紧serMessage"ConstVERSIONAsString=DBLSPACE&"Version1.1.12003-Apr-04"ConstREPBACKAsString=DBLSPACE&"Pleas围脸裂爱均ereportfailure"&_"tothe开理千督氧注便反均microsoft.public.excel.programmingnewsgroup."ConstALLCLEARAsString=DBLSPACE&"Theworkbookshould"&_"nowbefreeofallpasswordprotection,som**esureyou:"&_DBLSPACE&"S**EITNOW!"&DBLSPACE&"andalso"&_DBLSPACE&"BACKUP!,BACKUP!!,BACKUP!!!"&_DBLSPACE&"Also,rememberthatthepasswordwas"&_"putthereforareason.Don'tstuffupcrucialformulas"&_"ordata."&DBLSPACE&"Accessanduseofsomedata"&_"maybeanoffense.Ifindoubt,don't."ConstMSGNOPWORDS1AsString="Therewerenopasswordson"&_"sheets,orworkbookstructureorwindows."&AUTh**ORS&VERSIONConstMSGNOPWORDS2AsString="Therewasnoprotectionto"&_"workbookstructureorwindows."&DBLSPACE&_"Proceedingtounprotectsheets."&AUTh**ORS&VERSIONConstMSGT**ETIMEAsString="AfterpressingOKbuttonthis"&_"willt**esometime."&DBLSPACE&"Amountoftime"&_"dependsonhowmanydifferentpasswords,the"&_"passwords,andyourcomputer'sspecification."&DBLSPACE&_"Justbepatient!M**emeacoffee!"&AUTh**ORS&VERSIONConstMSGPWORDFOUND1AsString="YouhadaWorksheet"&_"StructureorWindowsPasswordset."&DBLSPACE&_"Thepasswordfoundwas:"&DBLSPACE&"$$"&DBLSPACE&_"Noteitdownforpotentialfutureuseinotherworkbooksby"&_"thesamepersonwhosetthispassword."&DBLSPACE&_"Nowtocheckandclearotherpasswords."&AUTh**ORS&VERSIONConstMSGPWORDFOUND2AsString="YouhadaWorksheet"&_"passwordset."&DBLSPACE&"Thepasswordfoundwas:"&_DBLSPACE&"$$"&DBLSPACE&"Noteitdownforpotential"&_"futureuseinotherworkbooksbysamepersonwho"&_"setthispassword."&DBLSPACE&"Nowtocheckandclear"&_"otherpasswords."&AUTh**ORS&VERSIONConstMSGONLYONEAsString="Onlystructure/windows"&_"protectedwiththepasswordthatwasjustfound."&_ALLCLEAR&AUTh**ORS&VERSION&REPBACKDimw1AsWorksheet,w2AsWorksheetDimiAsInteger,jAsInteger,kAsInteger,lAsIntegerDimmAsInteger,nAsInteger,i1AsInteger,i2AsIntegerDimi3AsInteger,i4AsInteger,i5AsInteger,i6AsIntegerDimPWord1AsStringDimShTagAsBoolean,WinTagAsBoolean
Application.ScreenUpdating=FalseWithActiveWorkbookWinTag=.ProtectStructureOr.ProtectWindowsEndWithShTag=FalseForEachw1InWorksheetsShTag=ShTagOrw1.ProtectContentsNextw1IfNotShTagAndNotWinTagThenMsgBoxMSGNOPWORDS1,vbInformation,h**EADERExitSubEndIfMsgBoxMSGT**ETIME,vbInformation,h**EADERIfNotWinTagThenMsgBoxMSGNOPWORDS2,vbInformation,h**EADERElseOnErrorResumeNextDo'**mmydoloopFori=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,h**EADERExitDo'BypassallfornextsEndIfEndWithNext:Next:Next:Next:Next:NextNext:Next:Next:Next:Next:NextLoopUntilTrueOnErrorGoTo0EndIfIfWinTagAndNotShTagThenMsgBoxMSGONLYONE,vbInformation,h**EADERExitSubEndIfOnErrorResumeNextForEachw1InWorksheets'AttemptclearancewithPWord1w1.UnprotectPWord1Nextw1OnErrorGoTo0ShTag=FalseForEachw1InWorksheets'ChecksforallclearShTagtriggeredto1ifnot.ShTag=ShTagOrw1.ProtectContentsNextw1IfShTagThenForEachw1InWorksheetsWithw1If.ProtectContentsThenOnErrorResumeNextDo'DummydoloopFori=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,h**EADER'leveragefindingPwordbytryingonothersheetsForEachw2InWorksheetsw2.UnprotectPWord1Nextw2ExitDo'BypassallfornextsEndIfNext:Next:Next:Next:Next:NextNext:Next:Next:Next:Next:NextLoopUntilTrueOnErrorGoTo0EndIfEndWithNextw1EndIfMsgBoxALLCLEAR&AUTh**ORS&VERSION&REPBACK,vbInformation,h**EADEREndSub
点击菜单栏上的工具“宏”选AllInternalPasswords,执行,确定两次;耐心等一会,再点击两次确定,
在此打开自己加密的excel,看看,密码是不是没有了。