您好,excel锁定后忘记密码的解决办法
首先打开设置了工作表保护的表格,可以看到,当我们试图编辑时,会弹出这样的对话框。
这时如果我们忘记了密码,可以使用宏命令来将密码显示出来,然后输入正确的密码即可。具体操作时,要先将宏命令的相关工具按钮调出来。单击文件——选项——自定义功能区——在“开发工具”前打勾——确定。
单击工具栏——开发工具——宏,新建宏。然后保存。
编辑该宏,复制下列代码粘贴到宏的内容中去。
Sub PasswordBreaker()
Dim i As Integer, j As Integer, k As Integer
Dim l As Integer, m As Integer, n As Integer
Dim i1 As Integer, i2 As Integer, i3 As Integer
Dim i4 As Integer, i5 As Integer, i6 As Integer
On Error Resume Next
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 i1 = 65 To 66
For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66
For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126
ActiveSheet.Unprotect Chr(i) & Chr(j) & Chr(k) & _
Chr(l) & Chr(m) & Chr(i1) & Chr(i