title: command line not working when run from vba
body: <p>I'm trying to unzip a file via my VBA code. I'm using 7z command line to unzip the file. However the command works when run from normal command prompt but the same command is not working when run via VBA code. </p>
  
  <pre><code>Command:
  "C:\Program Files\7-Zip\7z.exe" x "C:\Users\Public\AppData\Local\Temp\Sample.zip"
  </code></pre>
  
  <p>For further understanding, I'm trying to extract a docx file and that is why I am renaming it to .zip and then extracting.</p>
  
  <pre><code>Sub tst()
  Dim MyFile As String, Outdir As String, Cmdstr As String
  MyFile = Chr(34) &amp; "c:\TMP\ratings.gz" &amp; Chr(34)
  Outdir = Chr(34) &amp; "c:\tmp\0" &amp; Chr(34)
  Cmdstr = "c:\Program Files\7-Zip\7z.exe" &amp; " e " &amp; MyFile &amp; " -o" &amp; Outdir
  Debug.Print Cmdstr
  Call Shell(Cmdstr, 1)
  End Sub
  </code></pre>
  
  <p>I've used this type of function (similar) to unzip the file.</p>