ZIP AND UNZIP FROM MICROSOFT EXCEL USING VBAIndeed one of the most interesting features that has me quite excited, although I have not quite figured out how exactly to use it to my best advantage is the capability built into Microsoft Excel’2016 (do not try it in any other version below 2010, however) is that you can zip and unzip any .zip extension from within Excel. Just see the pictures below; I am not saying how useful it is exactly, until I try it out in depth myself, but you are allowed to put in your comments on how best you have used it to date.
Dim ShellApp As Object
' Target file & temp dir
TargetFile = Application.GetOpenFilename _
(FileFilter:="Zip Files (*.zip), *.zip")
If TargetFile = False Then Exit Sub
ZipFolder = Application.DefaultFilePath & "\Unzipped\"
' Create a temp folder
On Error Resume Next
On Error GoTo 0
' Copy the zipped files to the newly created folder
Set ShellApp = CreateObject("Shell.Application")
If MsgBox("The files was unzipped to:" & _
vbNewLine & ZipFolder & vbNewLine & vbNewLine & _
"View the folder?", vbQuestion + vbYesNo) = vbYes Then _
Shell "Explorer.exe /e," & ZipFolder, vbNormalFocus
Happy Programming !!
CA Vikram Shankar Mathur24-Sep-2019 | 12:55 Hours IST