EndWith
ShTag=False
ForEachw1InWorksheets
ShTag=ShTagOrw1.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)
MsgBoxApplication.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
w1.UnprotectPWord1
Nextw1
OnErrorGoTo0
ShTag=False
ForEachw1InWorksheets
'ChecksforallclearShTagtriggeredto1ifnot.
ShTag=ShTagOrw1.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)
MsgBoxApplication.Substitute(MSGPWORDFOUND2,_
"$$",PWord1),vbInformation,HEADER
'leveragefindingPwordbytryingonothersheets
ForEachw2InWorksheets
w2.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,运行,确定两次;
文章插图
【Excel撤销工作表保护密码图文教程2020攻略资讯】
文章插图
推荐阅读
- excel输入身份证号变成0解决方法知识科普
- EXCEL不同单元格需要输入密码后才能修改速来看看
- Excel-2010中自定义进行筛选并依次编号推荐阅读
- 利用Text函数在Excel-2013中建立顺序编号科普大全
- ie浏览器工具菜单在哪答案
- 在Excel-2010中控件的使用以及隐藏组合框2020开心玩
- Excel-2013表格中根据销售日期算出月份交易总金额升级必备
- 假期综合症 4妙招助你快速进入工作状态
- 怎么转换文件格式(文件格式转换)
- 快速提取出Excel-2010单元格括号内的文字信息读懂您就是高手