Extract all .gz file in folder using VBA Shell command Extract all .gz file in folder using VBA Shell command shell shell

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


WinZip path needs to be absolute path:

C:\Program Files\WinZip\winzip32'


Check your WinZip path. That needs to be fine fixed to the full path to your WinZip.