wps撤销工作表原始密码
问题补充说明:wps撤销工作表保护原始密码多少... wps撤销工作表保护原始密码多少 展开
下面是步骤方法:
1、打开需要破解保护密码的Excel文件;
2、依次长占妒选满点击菜单栏上的工具---宏----录制新宏,输入宏名字如:aa;
3、停止录计剧左说差将买成升占制(这样得到一个空宏);
4、依次点击菜单栏上的工具---宏----宏,选aa,点编辑按钮;
5、删除来自窗口中的所有字符(只360问答有衡凯几个),替换为下面的内容变念装支类清;拿差
从下面英文开始复制:
OptionExplicit
PublicSubAllInternalPasswords()
'Breaksworksheetandworkbookstructurepasswords.BobMcCormick
'probablyoriginatorofbasecodealgorithmmodifi种质整别止存混老edforcoverage
'ofworkbookstructure/windowspasswordsandformultiplepasswords
'
'NormanHarkerandJEMcGimpsey27-Dec-2002(Version1.1)
'Modified2003-Apr-04byJEM:Allmsg雨杆观村色女止功压stoconstants,and
'eliminat级责可讲eoneExitSub(V亚方拿古粮去ersion1.1.1)
'Revealshashed愿系才passwordsNOToriginalpass庆绿轴章季欢弱苦米words
ConstDBLSPACEAsString=vbNewLine&vbNewLine
ConstAUTHO石妈知害RSAsString=DBLSPACE&vbNewLine&_
"AdaptedfromBobMcCormickbasecodeby"&_
"NormanHarkerandJEMcGimpsey"
ConstHEADERAsString="AllInternalPasswordsUserMessage"
ConstVERSI但ONAsString=DBLSPACE&"Version1.1.12003-Apr-04"
ConstREPBACKAsString=DBLSPACE&"Pleas责怎即缺重审哥林固双管ereportfailure"&_
"tothemicrosoft.***.programmingne尼研非能预距木段wsgroup."
ConstALLCLEAR德沙写被地陆固太井始AsString=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."
ConstMSG身作消NOPWORDS1AsString="Therewerenopasswordso汽n"&_
"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
***.screenupdating=False
WithActiveWorkbook
WinTag=.ProtectStructureOr.ProtectWindows
EndWith
ShTag=False
ForEachw1InWorksheets
ShTag=ShTagOr***.protectcontents
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***.substitute(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
***.unprotectPWord1
Nextw1
OnErrorGoTo0
ShTag=False
ForEachw1InWorksheets
'ChecksforallclearShTagtriggeredto1ifnot.
ShTag=ShTagOr***.protectcontents
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***.substitute(MSGPWORDFOUND2,_
"$$",PWord1),vbInformation,HEADER
'leveragefindingPwordbytryingonothersheets
ForEachw2InWorksheets
***.unprotectPWord1
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
-------------------
复制到横线以上
6、关闭编辑窗口;
7、依次点击菜单栏上的工具---宏-----宏,选AllInternalPasswords,运行,确定两次;
8、等一会,就会出现以下对话框:这就是Excel密码对应的原始密码(此密码和原先设置的密码都能打开此文档。如果是别人的文档,又想恢复密码设置,就可以用此密码进行保护,就能用设置的密码打开。字母一定要大写):
再点击确定。Excel的原始密码就被清除了。
标签:wps,密码,撤销