Bonjour à tous,
J'ai un petit problème. Je réalise un code qui me permets d'imprimer des graphiques en PDF
Le problème c'est que certain de mes graphiques sont coupés comment résoudre se problème ? Je ne trouve pas le bon paramètre.... merci d'avance
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51 Sub Export_PDF() Dim ws As Worksheet, wsTemp As Worksheet Dim chrt As Shape Dim tp As Long Dim NewFileName As String On Error GoTo Whoa Application.ScreenUpdating = False NewFileName = "Mon_fichier" If ClasseurOuvert("tableau.xlsx") Then Windows("tableaux.xlsx").Activate Else Workbooks.Open ("C:\Tableaux.xlsx") End If Set ws = Sheets("Tableau") Set wsTemp = Sheets.Add tp = 5 With wsTemp For Each chrt In ws.Shapes chrt.Copy wsTemp.Range("A1").PasteSpecial Selection.Top = tp Selection.Left = 5 tp = tp + Selection.Height + 30 Next End With wsTemp.ExportAsFixedFormat Type:=xlTypePDF, Filename:=NewFileName, Quality:=xlQualityStandard, _ IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True Application.DisplayAlerts = False wsTemp.Delete LetsContinue: With Application .ScreenUpdating = True .DisplayAlerts = True End With Exit Sub Whoa: MsgBox Err.Description Resume LetsContinue End Sub
Partager