Bonjour,
Je rencontre un problème avec ce code sur la ligne With Fso.CreateTextFile(LeZip, True)
En vous remerciant pour l'aide que vous m'apporterez
Sub ZipFichier()
Dim oShell As Object, Fso As Object
Dim i As Long
Dim Fichier As String, MyBinary As String
Dim LeZip As Variant
Dim MyHex As Variant
Fichier = "E:\Users\Castor\desktop\FichesRetour"
LeZip = "E:\Users\Castor\desktop.zip"
Set Fso = CreateObject("Scripting.FileSystemObject")
MyHex = _
Array(80, 75, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
For i = 0 To UBound(MyHex)
MyBinary = MyBinary & Chr(MyHex(i))
Next
With Fso.CreateTextFile(LeZip, True)
.Write MyBinary
.Close
End With
Set oShell = CreateObject("Shell.Application")
oShell.Namespace(LeZip).CopyHere (Fichier)
Set oShell = Nothing
End Sub