Bonjour j'aimerais que vous m'aidiez à débugué mon code :
Sub SauvegarderFacture()
Dim wb1 As Workbook
Dim wb2 As Workbook
Dim cheminwk2 As String
Range("Invoice").Value = Range("Facture").Value
'ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & "\" & "Facture" & "\" & Range("C7").Value & "-" & Range("C16").Value, FileFormat:=xlOpenXMLWorkbook
Set wb1 = ThisWorkbook
'Set wb2 = ActiveWorkbook
'cheminwk2 = ThisWorkbook.Path & "\" & "Sauvegarde" & ".xlsm"
cheminwk2 = "C:\Users\ThinkCentre\Desktop\Sauvegarde.xlsm"
Workbooks.Open cheminwk2
Set wb2 = ActiveWorkbook
wb1.Sheets("Invoice").Copy after:=wb2.Sheets(Sheets.Count)
activesheets.Name = ActiveSheet.Range("C8").Value & "-" & Year(ActiveSheet.Range("F5").Value)
End Sub
Sub SauvegarderFacture()
Dim wb1 As Workbook
Dim wb2 As Workbook
Dim cheminwk2 As String
Range("Invoice").Value = Range("Facture").Value
'ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & "\" & "Facture" & "\" & Range("C7").Value & "-" & Range("C16").Value, FileFormat:=xlOpenXMLWorkbook
Set wb1 = ThisWorkbook
'Set wb2 = ActiveWorkbook
'cheminwk2 = ThisWorkbook.Path & "\" & "Sauvegarde" & ".xlsm"
cheminwk2 = "C:\Users\ThinkCentre\Desktop\Sauvegarde.xlsm"
Workbooks.Open cheminwk2
Set wb2 = ActiveWorkbook
wb1.Sheets("Invoice").Copy after:=wb2.Sheets(Sheets.Count)
activesheets.Name = ActiveSheet.Range("C8").Value & "-" & Year(ActiveSheet.Range("F5").Value)
End Sub