Unzip folder with files to the chosen location
<p>Team, I am working upon extract the zip file from VBA code but getting error, here is my code:</p>

<pre><code>Sub Un_Zip_File()
Dim flname As String
Call PathCall
flname = Dir(impathn &amp; "Transactions*.zip")
Call PathCall
Call UnZip_File(impathn, flname)
End Sub

Sub UnZip_File(strTargetPath As String, fname As Variant)
Dim oApp As Object, FSOobj As Object
Dim FileNameFolder As Variant

If Right(strTargetPath, 1) &lt;&gt; Application.PathSeparator Then
strTargetPath = strTargetPath &amp; Application.PathSeparator
End If

FileNameFolder = strTargetPath

'destination folder if it does not exist
Set FSOobj = CreateObject("Scripting.FilesystemObject")
If FSOobj.FolderExists(FileNameFolder) = False Then
FSOobj.CreateFolder FileNameFolder
End If

Set oApp = CreateObject("Shell.Application")
oApp.Namespace(FileNameFolder).CopyHere oApp.Namespace(fname).Items

Set oApp = Nothing
Set FSOobj = Nothing
Set FileNameFolder = Nothing

End Sub
</code></pre>

<p>When I am running Un_zip_file macro, I am getting error:</p>

<blockquote>
  <p>Object variables or with block variable not set</p>
</blockquote>

<p>after debug moving on</p>

<pre><code>oApp.Namespace(FileNameFolder).CopyHere oApp.Namespace(fname).Items
</code></pre>