'如果要批量清除工作表保护密码,建议代码如下,否则将粗体字部分代码改成:
'Call 你的程序名称
'(注:如果要批量破解密码,几百个工作簿,上千个工作表,你可能要破解几个月,如果密码复杂点,或许几年都破解不出来,还是建议用以下代码清除为好)
Sub 批量清除工作表保护密码()
Dim myPath$, myFile$, AK As Workbook, sh As Worksheet
Application.ScreenUpdating = False
myPath = ThisWorkbook.Path & "\"
myFile = Dir(myPath & "*.xls")
Do While myFile <> ""
If myFile <> ThisWorkbook.Name Then
Set AK = Workbooks.Open(myPath & myFile)
For Each sh In Worksheets
sh.Protect AllowFiltering:=True
sh.Unprotect
Next
AK.Close True
End If
myFile = Dir
Loop
Application.ScreenUpdating = True
End Sub