title: Unzipping a file to a remote directory in VBA
body: <p>I have a project where I need to extract a file from a zip, and then open that file. I had it working last week with the code: </p>
  
  <pre><code> With CreateObject("Shell.Application")
          .Namespace("" &amp; UnZippedFolder).copyhere .Namespace("" &amp; ZipFolder &amp; _ 
                         ZipFile).Items
   End With
  </code></pre>
  
  <p>When I tried to run it this week, I got a bunch of errors as I tried to debug it.</p>
  
  <p>I've moved from 'simple' (above) to 'as explicit as I can figure out' (below). I'm currently getting the error, "Object variable or With block variable not set." with the line selected that has '*' at the end. I can't figure out why this error is being thrown, or how to fix it.</p>
  
  <pre><code>Dim WeekNum As Integer
  Dim ZipFolder As String
  Dim ZipFile As String
  Dim UnZippedFile As String
  Dim UnZippedFolder As String
  Dim objShell
  Dim UZipFold
  Dim ZipFoldAndFile
  If Proceed = False Then Exit Sub
  
  WeekNum = Workbooks("personal.xlsb").Sheets("Dates").Range("WeekNum").Value
  ZipFolder = "\\server\path\" ' obfuscated because I must, sorry
  ZipFile = "Prefix" &amp; "Week" &amp; WeekNum &amp; " (xlsx 07 format).zip" ' change the 11 to the last 2 digits of the year! 
  UnZippedFolder = "\\server\path\" ' obfuscated, again, because I must
  UnZippedFile = "Logging_11" &amp; "Week" &amp; WeekNum &amp; " (xlsx 07 format).xlsx"
  
  Set objShell = New Shell
  UZipFold = objShell.Namespace("" &amp; UnZippedFolder)
  ZipFoldAndFile = objShell.Namespace("" &amp; ZipFolder &amp; ZipFile)
  
  UZipFold.copyhere (objShell.Namespace("" &amp; ZipFolder &amp; ZipFile).Items) '*'
  </code></pre>