buivankiet
Thành viên mới
- Tham gia
- 30/5/08
- Bài viết
- 38
- Được thích
- 6
Trên diễn đàn có code bằng vba unzip nhưng khi sửa lại unrar thì bị báo lỗi " unknown option " -min-e ". Nhờ các bạn sửa lại dùm, các code như sau
Sub unRar_file()
Dim PathWinRar As String, FileNameRar As String, FileNameXls As String
Dim ShellStr As String
'Dim strDate As String
PathWinRar = "C:\Program Files\WinRAR\"
'This will check if this is the path where WinRar is installed.
If Dir(PathWinRar & "WinRAR.exe") = "" Then
MsgBox "Please find your copy of WinRAR.exe and try again"
Exit Sub
End If
FileNameZip = "C:\Data\Test.rar"
FolderName = "C:\Data\"
ShellStr = PathWinRar & "WinRAR -min-e" _
& " " & Chr(34) & FileNameRar & Chr(34) _
& " " & Chr(34) & FolderName & Chr(34)
ShellAndWait ShellStr, vbHide
MsgBox "Look in " & FolderName & " for extracted files"
End Sub
Cám ơn trước,
Sub unRar_file()
Dim PathWinRar As String, FileNameRar As String, FileNameXls As String
Dim ShellStr As String
'Dim strDate As String
PathWinRar = "C:\Program Files\WinRAR\"
'This will check if this is the path where WinRar is installed.
If Dir(PathWinRar & "WinRAR.exe") = "" Then
MsgBox "Please find your copy of WinRAR.exe and try again"
Exit Sub
End If
FileNameZip = "C:\Data\Test.rar"
FolderName = "C:\Data\"
ShellStr = PathWinRar & "WinRAR -min-e" _
& " " & Chr(34) & FileNameRar & Chr(34) _
& " " & Chr(34) & FolderName & Chr(34)
ShellAndWait ShellStr, vbHide
MsgBox "Look in " & FolderName & " for extracted files"
End Sub
Cám ơn trước,
Lần chỉnh sửa cuối: