第3个回答 2016-08-27
如果Excel文件的打开密码忘记了,且密码是6位数以内的数字,可用以下步骤解开(关掉所有程序,为了速度):
新开一Excel,同时按Alt和F11,进入VBA界面,点菜单上的插入,模块,在新出来的窗口粘贴一下代码:
Sub crack()
Dim i As Long
Dim FileName As String
i = 0
FileName = Application.GetOpenFilename("Excel文件(*.xls & *.xlsx),*.xls;*.xlsx", , "VBA破解")
FileName = Right(FileName, Len(FileName) - InStrRev(FileName, "\"))
Application.ScreenUpdating = False
line2: On Error GoTo line1
Workbooks.Open FileName, , True, , i
MsgBox "Password is " & i
Exit Sub
line1: i = i + 1
Resume line2
Application.ScreenUpdating = True
End Sub
然后在此界面直接按F5运行此宏,选择文件,等啊等(看密码长度了)本回答被提问者采纳