Does a folder need to be unzipped in order for a macro to access its files? I am trying to move files from a zipped file to their respective folder and would like to know if the folder needs to be unzipped for a File System Object to copy it. Thanks
Asked
Active
Viewed 36 times
0
1 Answers
0
Sub MoveFiles()
Dim FSO As Object
Dim SourceFileName As String, DestinFileName As String
Set FSO = CreateObject("Scripting.Filesystemobject")
SourceFileName = Sheets("NIS File Allocation").Cells(2, 2).Value
DestinFileName = Sheets("NIS File Allocation").Cells(2, 7).Value
MsgBox FSO.FileExists(SourceFileName)
Call FSO.CopyFile(SourceFileName, DestinFileName, False)
MsgBox (SourceFileName + " Copied to " + DestinFileName)
End Sub
When running this code, SourceFileName must be in an unzipped folder in order to copy it to the destination file. Otherwise a "Path Not Found" Error will result. Tested with .FileExists

David Podolak
- 195
- 2
- 10
[Can Windows' built-in ZIP compression be scripted?](https://stackoverflow.com/questions/30211/can-windows-built-in-zip-compression-be-scripted/124775#124775) – busybyte Mar 15 '19 at 19:27