Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub GetFileList()
Dim Path As String
On Error Resume Next
Path = Application.InputBox("请输入路径")
If Path = "" Then Exit Sub
If Right(Path, 1) <> "\" Then Path = Path & "\"
If Dir(ThisWorkbook.Path & "\RarFileList.txt") <> "" Then Kill ThisWorkbook.Path & "\RarFileList.txt"
Shell "cmd /c " & ThisWorkbook.Path & "\rar vb " & Path & "*.rar >>" & ThisWorkbook.Path & "\RarFileList.txt", vbHide
Do While Dir(ThisWorkbook.Path & "\RarFileList.txt") = ""
DoEvents
Loop
Sleep 600
If Dir(ThisWorkbook.Path & "\RarFileList.txt") <> "" Then Workbooks.OpenText Filename:=ThisWorkbook.Path & "\RarFileList.txt", DataType:=xlDelimited
End Sub