Bonjour à tous,
Suite à ma demande précédente, comment transformer mon fichier zip en xlsm
En vous remerçiant.
	
	
	
	
	
		
Merci
Nicolas
	
		
			
		
		
	
				
			Suite à ma demande précédente, comment transformer mon fichier zip en xlsm
En vous remerçiant.
		VB:
	
	
	    Dim Source, Destination, MyHex, MyBinary
    Dim oShell, oApp, oFolder, oCTF, oFile
    Dim oFileSys
    
    'Spécifiez le répertoire
    Source = "D:\Users\Nicolas\Desktop\TestZip"
    Destination = "D:\Users\Nicolas\Desktop\maSauvegarde.zip"
    
    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
    
    Set oShell = CreateObject("WScript.Shell")
    Set oFileSys = CreateObject("Scripting.FileSystemObject")
    
    'Création de la base du fichier zip.
    Set oCTF = oFileSys.CreateTextFile(Destination, True)
    oCTF.Write MyBinary
    oCTF.Close
    Set oCTF = Nothing
    
    Set oApp = CreateObject("Shell.Application")
    
    Set oFolder = oApp.Namespace(Source)
    If Not oFolder Is Nothing Then _
        oApp.Namespace(Destination).CopyHere oFolder.Items
    
    Set oFile = Nothing
    On Error Resume Next
    
    Do While (oFile Is Nothing)
        'Attention: provoque une erreur 70 si un des fichiers à zipper
        'est toujours ouvert.
        Set oFile = oFileSys.OpenTextFile(Destination, ForAppending, False)
        
        If Err.Number <> 0 Then
            Err.Clear
        End If
    Loop
	Merci
Nicolas