Extract all .gz file in folder using VBA Shell command
You should try with the full path of the shell command, like this, that worked for me:
Sub extractAllFiles() Dim MyObj As Object, MySource As Object, file As Variant Dim shellStr As String file = Dir("C:\Downloads\") While (file <> "") If InStr(1, file, ".gz") > 0 Then shellStr = "C:\Program Files (x86)\WinZip\winzip32 -e C:\Downloads\" & file & " C:\Downloads\" Call Shell(shellStr, vbHide) End If file = Dir WendEnd Sub
My winzip is installed as C:\Program Files (x86)\WinZip\winzip32. You should use yours.Your install path may be:
C:\Program Files\WinZip\winzip32