Using VBA to Unzip problem

cstimart

Well-known Member
Joined
Feb 25, 2010
Messages
1,180
Hello,

Using this code I found on the www...

Code:
Function UnZip(strTargetPath As String, Fname As Variant)
Dim oApp As Object, FSOobj As Object
Dim FileNameFolder As Variant

If Right(strTargetPath, 1) <> Application.PathSeparator Then
    strTargetPath = strTargetPath & Application.PathSeparator
End If

FileNameFolder = strTargetPath
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

If Not oApp Is Nothing Then Set oApp = Nothing
If Not FSOobj Is Nothing Then Set FSOobj = Nothing
If Not FileNameFolder Is Nothing Then Set FileNameFolder = Nothing
End Function

...I am encountering issue where a zip file contains 1,800 pdfs, but the extract stops after less than 100.

Any ideas why that happens and/or how to resolve?

Thanks!
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
To further explain, this extract has 1,800 pdfs and a csv file that contains information pertinent to those pdfs. I will be importing the csv data into a table and then moving the pdfs to a specified location further in the process.
 
Upvote 0

Forum statistics

Threads
1,214,388
Messages
6,119,226
Members
448,878
Latest member
Da9l87

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top