VBA取消工作表或工作薄密码保护
Posted zhujie-com
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了VBA取消工作表或工作薄密码保护相关的知识,希望对你有一定的参考价值。
Sub 取消工作表保护()
Dim sht As Worksheet
For Each sht In Worksheets
sht.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
, AllowFiltering:=True, AllowUsingPivotTables:=True
sht.Protect DrawingObjects:=False, Contents:=True, Scenarios:=
False, AllowFiltering:=True, AllowUsingPivotTables:=True
sht.Protect DrawingObjects:=True, Contents:=True, Scenarios:=
False, AllowFiltering:=True, AllowUsingPivotTables:=True
sht.Protect DrawingObjects:=False, Contents:=True, Scenarios:=
True, AllowFiltering:=True, AllowUsingPivotTables:=True
sht.Unprotect
Next
MsgBox "已破解"
End Sub
Sub 破解工作薄密码()
Dim sh As Worksheet
ActiveWorkbook.Sheets.Copy
For Each sh In ActiveWorkbook.Sheets
sh.Visible = True
Next
End Sub
以上是关于VBA取消工作表或工作薄密码保护的主要内容,如果未能解决你的问题,请参考以下文章