I have a piece of code that zips two files:
'Deleting ZIP file and creating new one
Set FSO = CreateObject("Scripting.FileSystemObject")
if fso.fileExists("C:\Test.zip") then
fso.DeleteFile("C:\Test.zip")
end if
' creating zip file
set file = FSO.CreateTextFile("Test.zip")
file.write("PK" & chr(5) & chr(6) & string(18,chr(0)))
file.close
'Coping files to ZIP file
Set objShell = CreateObject("shell.Application")
Set objFolderZIP = objShell.NameSpace("C:\Test.zip")
cnt = objFolderZIP.Items.Count + 1
objFolderZIP.CopyHere("C:\Zip01.xls")
While objFolderZIP.Items.Count < cnt
WScript.Sleep 100
Wend
cnt = objFolderZIP.Items.Count + 1
objFolderZIP.CopyHere("C:\Zip02.xls")
While objFolderZIP.Items.Count < cnt
WScript.Sleep 100
wend
MsgBox "Files ZIP-ed"
Both files are copied to .zip folder with no issues. Problem is that, if files are large, message box "Files ZIP-ed" is popping up while files are still being compressed, there is loading bar for compressing. I would like pop up message to appear after files are completely compressed(copied to .zip file).