|
- Public Sub ClearProtect()
- Application.DisplayAlerts = False
- On Error Resume Next
- If ActiveWorkbook.ActiveSheet.ProtectContents = True Then
- With ActiveWorkbook.ActiveSheet
- .Activate
- .Protect DrawingObjects:=True, Contents:=True, AllowFiltering:=True
- .Protect DrawingObjects:=False, Contents:=True, AllowFiltering:=True
- .Protect DrawingObjects:=True, Contents:=True, AllowFiltering:=True
- .Protect DrawingObjects:=False, Contents:=True, AllowFiltering:=True
- .Unprotect
- End With
- End If
- Application.DisplayAlerts = True
- MsgBox "當前活動工作表保護密碼已經被清除。", 64 + 0, "提示"
- End Sub
复制代码 |
|