Ich verwende den Zip-Code von http://www.rondebruin.nl.
Bisher hat der Code auch funktioniert.
Seit kurzem erscheint beim ausführen des Makros der Fehler:
"Die Methode NameSpace für das Objekt IShellDispatch4"
Woran kann dies liegen?
Hier noch der vereinfachte Code:
-----------------------------------------------------------------------------------
Sub Zip_All_Files_in_Folder()
Dim FileNameZip, FolderName
Dim strDate As String, DefPath As String
Dim oApp As Object
DefPath = Application.DefaultFilePath
If Right(DefPath, 1) "\" Then
DefPath = DefPath & "\"
End If
FolderName = "Z:\PL08T\betriebe\928770\" '
Sub NewZip(sPath)
'Create empty Zip File
'Changed by keepITcool Dec-12-2005
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
Function bIsBookOpen(ByRef szBookName As String) As Boolean
' Rob Bovey
On Error Resume Next
bIsBookOpen = Not (Application.Workbooks(szBookName) Is Nothing)
End Function
Function Split97(sStr As Variant, sdelim As String) As Variant
'Tom Ogilvy
Split97 = Evaluate("{""" & _
Application.Substitute(sStr, sdelim, """,""") & """}")
End Function