Zipped file created opens with WinZip, but explorer shows empty zip file

Mar 17, 2008 at 4:56 PM
A weird issue I have come across recently. I create a new zip file, add a file to it, and save the zip file. Everything works great. I can extract and view the zipped file(s) with WinZip. However, If I try to extract from explorer (Windows XP), it shows the zip file as empty. Code below

Dim zFile As ZipFile

If File.Exists(strZipFile) Then
File.Delete(strZipFile)
End If

zFile = New ZipFile(strZipFile)
zFile.AddFile(strExcelFile)
zFile.Save()
Mar 17, 2008 at 6:15 PM
I actually figured this out after reading a little more into the help file for the AddFile Method within the ZipFile Class.

I modified my code from zFile.AddFile(strExcelFile) to zFile.AddFile(strExcelFile, ""), and this seemed to fix my issue regarding explorer.