VBA取消工作表或工作薄密码保护

女生的网名这么多〃 提交于 2019-12-01 13:59:29

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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!