1.将你要破解的Excel文件关闭,切记一定要关闭呀!然后新建一个Excel文件2.打开新建的这个Excel,按下alt+F11,打开vb界面,新建一个模块,如图所示3.将代码复制到这个模块中,代码如下:PrivateSubVBAPassword()'你要解保护的Excel文件路径Filename=Application.GetOpenFilename("Excel文件(*.xls&*.xla&*.xlt),*.xls;*.xla;*.xlt",,"VBA破解")IfDir(Filename)=""ThenMsgBox"没找到相关文件,清重新设置。"ExitSubElseFileCopyFilename,Filename&".bak"'备份文件。EndIfDimGetDataAsString*5OpenFilenameForBinaryAs#1DimCMGsAsLongDimDPBoAsLongFori=1ToLOF(1)Get#1,i,GetDataIfGetData="CMG="""ThenCMGs=iIfGetData="[Host"ThenDPBo=i-2:ExitForNextIfCMGs=0ThenMsgBox"请先对VBA编码设置一个保护密码...",32,"提示"ExitSubEndIfDimStAsString*2Dims20AsString*1'取得一个0D0A十六进制字串Get#1,CMGs-2,St'取得一个20十六制字串Get#1,DPBo+16,s20'替换加密部份机码Fori=CMGsToDPBoStep2Put#1,i,StNext'加入不配对符号If(DPBo-CMGs)Mod2<>0ThenPut#1,DPBo+1,s20EndIfMsgBox"文件解密成功......",32,"提示"Close#1EndSub4.然后点击运行按钮,如图所示,绿色的小三角就是5.你会看到,打开了一个文件夹,找到我们要破解的这个文件,然后点击打开6.稍等几分钟你就会看到破解成功的提示了1\打开文件2\工具---宏----录制新宏---输入名字如:aa3\停止录制(这样得到一个空宏)4\工具---宏----宏,选aa,点编辑按钮5\删除窗口中的所有字符(只有几个),替换为下面的内容:(复制吧)6\关闭编辑窗口7\工具---宏-----宏,选AllInternalPasswords,运行,确定两次,等2分钟,再确定.OK,没有密码了!!内容如下:PublicSubAllInternalPasswords()'Breaksworksheetandworkbookstructurepasswords.BobMcCormick'probablyoriginatorofbasecodealgorithmmodifiedforcoverage'ofworkbookstructure/windowspasswordsandformultiplepasswords''NormanHarkerandJEMcGimpsey27-Dec-2002(Version1.1)'Modified2003-Apr-04byJEM:Allmsgstoconstants,and'eliminateoneExitSub(Version1.1.1)'RevealshashedpasswordsNOToriginalpasswordsConstDBLSPACEAsString=vbNewLine&vbNewLineConstAUTHORSAsString=DBLSPACE&vbNewLine&_"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."&AUTHORS&VERSIONConstMSGNOPWORDS2AsString="Therewasnoprotectionto"&_"workbookstructureorwindows."&DBLSPACE&_"Proceedingtounprotectsheets."&AUTHORS&VERSIONConstMSGTAKETIMEAsString="AfterpressingOKbuttonthis"&_"willtakesometime."&DBLSPACE&"Amountoftime"&_"dependsonhowmanydifferentpasswords,the"&_"passwords,andyourcomputer'sspecification."&DBLSPACE&_"Justbepatient!Makemeacoffee!"&AUTHORS&VERSIONConstMSGPWORDFOUND1AsString="YouhadaWorksheet"&_"StructureorWindowsPasswordset."&DBLSPACE&_"Thepasswordfoundwas:"&DBLSPACE&"$$"&DBLSPACE&_"Noteitdownforpotentialfutureuseinotherworkbooksby"&_"thesamepersonwhosetthispassword."&DBLSPACE&_"Nowtocheckandclearotherpasswords."&AUTHORS&VERSIONConstMSGPWORDFOUND2AsString="YouhadaWorksheet"&_"passwordset."&DBLSPACE&"Thepassw...