欢迎来到天天文库
浏览记录
ID:35228809
大小:52.43 KB
页数:8页
时间:2019-03-22
《解除execl表格保护密码》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、第一种方法创建宏名:秋の痕Sub秋の痕() DimiAsInteger,jAsInteger,kAsInteger DimlAsInteger,mAsInteger,nAsInteger Dimi1AsInteger,i2AsInteger,i3AsInteger Dimi4AsInteger,i5AsInteger,i6AsInteger OnErrorResumeNext Fori=65To66:Forj=65To66:Fork=65To66 Forl=65To66:Form=6
2、5To66:Fori1=65To66 Fori2=65To66:Fori3=65To66:Fori4=65To66 Fori5=65To66:Fori6=65To66:Forn=32To126 ActiveSheet.UnprotectChr(i)&Chr(j)&Chr(k)&_ Chr(l)&Chr(m)&Chr(i1)&Chr(i2)&Chr(i3)&_ Chr(i4)&Chr(i5)&Chr(i6)&Chr(n) IfActiveSheet.ProtectContents=Fal
3、seThen MsgBox"Oneusablepasswordis"&Chr(i)&Chr(j)&_ Chr(k)&Chr(l)&Chr(m)&Chr(i1)&Chr(i2)&_ Chr(i3)&Chr(i4)&Chr(i5)&Chr(i6)&Chr(n) ActiveWorkbook.Sheets(1).Select Range("a1").FormulaR1C1=Chr(i)&Chr(j)&_ Chr(k)&Chr(l)&Chr(m)&Chr(i1)&Chr(i2)&_ Chr(
4、i3)&Chr(i4)&Chr(i5)&Chr(i6)&Chr(n) ExitSub EndIf Next:Next:Next:Next:Next:Next Next:Next:Next:Next:Next:Next EndSub第二种方法:PublicSubAllInternalPasswords()'Breaksworksheetandworkbookstructurepasswords.BobMcCormick'probablyoriginatorofbasecodealgorit
5、hmmodifiedforcoverage'ofworkbookstructure/windowspasswordsandformultiplepasswords'NormanHarkerandJEMcGimpsey27-Dec-2002(Version1.1)'Modified2003-Apr-04byJEM:Allmsgstoconstants,and'eliminateoneExitSub(Version1.1.1)'RevealshashedpasswordsNOToriginalpass
6、wordsConstDBLSPACEAsString=vbNewLine&vbNewLineConstAUTHORSAsString=DBLSPACE&vbNewLine&_"AdaptedfromBobMcCormickbasecodeby"&_"NormanHarkerandJEMcGimpsey"ConstHEADERAsString="AllInternalPasswordsUserMessage"ConstVERSIONAsString=DBLSPACE&"Version1.1.1200
7、3-Apr-04"ConstREPBACKAsString=DBLSPACE&"Pleasereportfailure"&_"tothemicrosoft.public.excel.programmingnewsgroup."ConstALLCLEARAsString=DBLSPACE&"Theworkbookshould"&_"nowbefreeofallpasswordprotection,somakesureyou:"&_DBLSPACE&"SAVEITNOW!"&DBLSPACE&"and
8、also"&_DBLSPACE&"BACKUP!,BACKUP!!,BACKUP!!!"&_DBLSPACE&"Also,rememberthatthepasswordwas"&_"putthereforareason.Don'tstuffupcrucialformulas"&_"ordata."&DBLSPACE&"Accessanduseofsomedata"&_"maybeanoffense.Ifindoubt,don't."ConstMSGNOPWORDS1AsString
此文档下载收益归作者所有