Sub 撤消工作表密码保护的宏代码()

Dim wks As Worksheet

Dim i As Integer, j As Integer, k As Integer

Dim l As Integer, m As Integer, n As Integer

Dim o As Integer, p As Integer, q As Integer

Dim r As Integer, s As Integer, t As Integer

On Error Resume Next

For Each wks In Worksheets

with wks

If .ProtectContents Then

Do

For i = 65 To 66: For j = 65 To 66: For k = 65 To 66

For l = 65 To 66: For m = 65 To 66: For n = 65 To 66

For o = 65 To 66: For p = 65 To 66: For q = 65 To 66

For r = 65 To 66: For s = 65 To 66: For t = 32 To 126

.Unprotect Chr(i) & Chr(j) & Chr(k) & Chr(l) & Chr(m) & Chr(n) & _

Chr(o) & Chr(p) & Chr(q) & Chr(r) & Chr(s) & Chr(t)

If .ProtectContents = False  Then

MsgBox “密码已找到!密码是:” & Chr(i) & Chr(j) & Chr(k) & Chr(l) & Chr(m) & Chr(n) & _

Chr(o) & Chr(p) & Chr(q) & Chr(r) & Chr(s) & Chr(t)

Exit Do

End If

Next: Next: Next: Next: Next: Next: Next: Next: Next: Next: Next: Next

Loop Until True

End If

End With

Next wks

End Sub

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。