/ Offices & Vba / 0浏览

[Excel VBA] 破解Excel工作簿保护

同事工作簿保护密码忘记了,正好找到一个,亲测有效,Excel2007通过。记录一下,以备不时之需。

Sub 破解工作薄保护()
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFiltering:=True, AllowUsingPivotTables:=True
ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _
False, AllowFiltering:=True, AllowUsingPivotTables:=True
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:= _
False, AllowFiltering:=True, AllowUsingPivotTables:=True
ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _
True, AllowFiltering:=True, AllowUsingPivotTables:=True
ActiveSheet.Unprotect
End Sub