清除忘记excel加密文件方法.docx

上传人:b****1 文档编号:15011738 上传时间:2023-06-29 格式:DOCX 页数:7 大小:15.66KB
下载 相关 举报
清除忘记excel加密文件方法.docx_第1页
第1页 / 共7页
清除忘记excel加密文件方法.docx_第2页
第2页 / 共7页
清除忘记excel加密文件方法.docx_第3页
第3页 / 共7页
清除忘记excel加密文件方法.docx_第4页
第4页 / 共7页
清除忘记excel加密文件方法.docx_第5页
第5页 / 共7页
清除忘记excel加密文件方法.docx_第6页
第6页 / 共7页
清除忘记excel加密文件方法.docx_第7页
第7页 / 共7页
亲,该文档总共7页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

清除忘记excel加密文件方法.docx

《清除忘记excel加密文件方法.docx》由会员分享,可在线阅读,更多相关《清除忘记excel加密文件方法.docx(7页珍藏版)》请在冰点文库上搜索。

清除忘记excel加密文件方法.docx

清除忘记excel加密文件方法

去除Excel工作表保护密码

很有用的小工具:

操作步骤:

1.打开需要破解密码的Excel;

2.Alt+F11,进入VBA编辑界面;

3.插入--模块(Module);

4.在右边Module的空白编辑区域,复制粘贴下面所有内容;

5.F5,运行该VBA命令;

OptionExplicit

PublicSubAllInternalPasswords()

'Breaksworksheetandworkbookstructurepasswords.BobMcCormick

'probablyoriginatorofbasecodealgorithmmodifiedforcoverage

'ofworkbookstructure/windowspasswordsandformultiplepasswords

'

'NormanHarkerandJEMcGimpsey27-Dec-2002(Version

'Modified2003-Apr-04byJEM:

Allmsgstoconstants,and

'eliminateoneExitSub(Version'RevealshashedpasswordsNOToriginalpasswords

ConstDBLSPACEAsString=vbNewLine&vbNewLine

ConstAUTHORSAsString=DBLSPACE&vbNewLine&_

"AdaptedfromBobMcCormickbasecodeby"&_

"NormanHarkerandJEMcGimpsey"

ConstHEADERAsString="AllInternalPasswordsUserMessage"

ConstVERSIONAsString=DBLSPACE&"Version2003-Apr-04"

ConstREPBACKAsString=DBLSPACE&"Pleasereportfailure"&_

"tothenewsgroup."

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&VERSION

ConstMSGNOPWORDS2AsString="Therewasnoprotectionto"&_

"workbookstructureorwindows."&DBLSPACE&_

"Proceedingtounprotectsheets."&AUTHORS&VERSION

ConstMSGTAKETIMEAsString="AfterpressingOKbuttonthis"&_

"willtakesometime."&DBLSPACE&"Amountoftime"&_

"dependsonhowmanydifferentpasswords,the"&_

"passwords,andyourcomputer'sspecification."&DBLSPACE&_

"Justbepatient!

Makemeacoffee!

"&AUTHORS&VERSION

ConstMSGPWORDFOUND1AsString="YouhadaWorksheet"&_

"StructureorWindowsPasswordset."&DBLSPACE&_

"Thepasswordfoundwas:

"&DBLSPACE&"$$"&DBLSPACE&_

"Noteitdownforpotentialfutureuseinotherworkbooksby"&_

"thesamepersonwhosetthispassword."&DBLSPACE&_

"Nowtocheckandclearotherpasswords."&AUTHORS&VERSION

ConstMSGPWORDFOUND2AsString="YouhadaWorksheet"&_

"passwordset."&DBLSPACE&"Thepasswordfoundwas:

"&_

DBLSPACE&"$$"&DBLSPACE&"Noteitdownforpotential"&_

"futureuseinotherworkbooksbysamepersonwho"&_

"setthispassword."&DBLSPACE&"Nowtocheckandclear"&_

"otherpasswords."&AUTHORS&VERSION

ConstMSGONLYONEAsString="Onlystructure/windows"&_

"protectedwiththepasswordthatwasjustfound."&_

ALLCLEAR&AUTHORS&VERSION&REPBACK

Dimw1AsWorksheet,w2AsWorksheet

DimiAsInteger,jAsInteger,kAsInteger,lAsInteger

DimmAsInteger,nAsInteger,i1AsInteger,i2AsInteger

Dimi3AsInteger,i4AsInteger,i5AsInteger,i6AsInteger

DimPWord1AsString

DimShTagAsBoolean,WinTagAsBoolean

=False

WithActiveWorkbook

WinTag=.ProtectStructureOr.ProtectWindows

EndWith

ShTag=False

ForEachw1InWorksheets

ShTag=ShTagOr

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)

MsgBox(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

PWord1

Nextw1

OnErrorGoTo0

ShTag=False

ForEachw1InWorksheets

'ChecksforallclearShTagtriggeredto1ifnot.

ShTag=ShTagOr

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)

MsgBox(MSGPWORDFOUND2,_

"$$",PWord1),vbInformation,HEADER

'leveragefindingPwordbytryingonothersheets

ForEachw2InWorksheets

PWord1

Nextw2

ExitDo'Bypassallfor...nexts

EndIf

Next:

Next:

Next:

Next:

Next:

Next

Next:

Next:

Next:

Next:

Next:

Next

LoopUntilTrue

OnErrorGoTo0

EndIf

EndWith

Nextw1

EndIf

MsgBoxALLCLEAR&AUTHORS&VERSION&REPBACK,vbInformation,HEADER

EndSub

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 自然科学

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2