en gros j'ai une erreur Sur la ligne souligné je veux enregistré en pdf un graphique d'un autre excel et ca a marché sur un histogramme et pas sur un camembert, je comprends pas pk
Sub testnontrg()
Dim Cls As Workbook
Dim LaDate As Date
Dim L As Date
Dim Chemin As String
Dim Dos As String
Dim SousDos As String
Dim Fichier As Variant
LaDate = Date 'date du jour
Dos = Year(LaDate) & "." & Format(Month(LaDate), "00")
L = DateSerial(Year(LaDate - Weekday(LaDate - 1) + 4), 1, 1)
SousDos = Year(LaDate) & "-S" & Int((LaDate - L + Weekday(L) + 5) / 7)
Fichier = Year(LaDate) & "-S" & Int((LaDate - L + Weekday(L) + 5) / 7) & ".xlsm"
Chemin = "xxxxx\" & Dos & "\" & SousDos & "\"
MsgBox Fichier
Set Cls = Workbooks.Open(Chemin & Fichier)
'enregistrement PDF
Sheets("MI").Activate
Range("A137:J155").Select
ActiveSheet.PageSetup.PrintArea = "$A$37:$J$155"
ChDir "C:\Users\naubin\Desktop\ebauche de projet"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\Users\naubin\Desktop\ebauche de projet\cause non trg 1.pdf", Quality:= _
xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
OpenAfterPublish:=False
With ThisWorkbook.Worksheets("PM03")
Sheets("PM03").Activate
ActiveWindow.SmallScroll Down:=-27
Range("A71:I90").Select
Range("P71").Activate
ActiveSheet.PageSetup.PrintArea = ActiveSheet.Range("$A$71:$I$90").Address
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\Users\naubin\Desktop\ebauche de projet\CAUSE NON TRG2.pdf", Quality _
:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
OpenAfterPublish:=False
End With
'fermeture du fichier
Cls.Close True
End Sub