From c:\mydir\miofile.zip to c:\mydir\unzipped\
Possible withouth any 3d part and exetrnal library?
Tks
Unzip file without any tupe of library
-
- PlatinumLounger
- Posts: 4362
- Joined: 26 Apr 2010, 17:36
-
- 4StarLounger
- Posts: 562
- Joined: 27 Jun 2021, 10:46
Re: Unzip file without any tupe of library
Depends very much by how you are defining 3rd party or external library. The Window Shell can do it ... But that's external . But if that's OK, then:
Code: Select all
Public Sub Example()
Dim strSourceZip As Variant ' do not make this a String
Dim strTargetFolder As Variant ' do not make this a String
strSourceZip = "D:\Downloads\1848_lvheader.zip"
strTargetFolder = "D:\Downloads\DeleteMe\unzips"
With CreateObject("Shell.Application")
.Namespace(strTargetFolder).CopyHere .Namespace(strSourceZip).Items ' all contents of zip folder
'.Namespace(strTargetFolder).CopyHere .Namespace(strSourceZip).Items.Item("frmLVClrHdr.frm") ' single file from zip
End With
End Sub
-
- PlatinumLounger
- Posts: 4362
- Joined: 26 Apr 2010, 17:36
Re: Unzip file without any tupe of library
TKS.SpeakEasy wrote: ↑27 Jul 2023, 13:13Depends very much by how you are defining 3rd party or external library. The Window Shell can do it ... But that's external . But if that's OK, then:
Code: Select all
Public Sub Example() Dim strSourceZip As Variant ' do not make this a String Dim strTargetFolder As Variant ' do not make this a String strSourceZip = "D:\Downloads\1848_lvheader.zip" strTargetFolder = "D:\Downloads\DeleteMe\unzips" With CreateObject("Shell.Application") .Namespace(strTargetFolder).CopyHere .Namespace(strSourceZip).Items ' all contents of zip folder '.Namespace(strTargetFolder).CopyHere .Namespace(strSourceZip).Items.Item("frmLVClrHdr.frm") ' single file from zip End With End Sub
WORK PERFECT!