i'm using the following code to compress a worksheet, but i get an error message that i would like to surpress...
Code
'zip
On Error Resume Next
Dim FileNameZip, FolderName
Dim strDate As String, DefPath As String
Dim oApp As Object
DefPath = "c:\temp\salesmanMDB\ed\"
If Right(DefPath, 1) <> "\" Then
DefPath = DefPath & "\"
End If
FolderName = "c:\temp\salesmanMDB\ed\" '<< Change
FileNameZip = DefPath & "ed_CustomerItemHistory" & ".zip"
'Create empty Zip File
NewZip (FileNameZip)
Set oApp = CreateObject("Shell.Application")
'Copy the files to the compressed folder
oApp.Namespace(FileNameZip).CopyHere oApp.Namespace(FolderName).items
Set oApp = Nothing
End Sub
Sub NewZip(sPath)
On Error Resume Next
If Len(Dir(sPath)) > 0 Then Kill sPath
Open sPath For Output As #1
Print #1, Chr$(80) & Chr$(75) & Chr$(5) & Chr$(6) & String(18, 0)
Close #1
End Sub
Display More
???
thank you.