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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
Option Explicit
'Paramètres fichier PowerPoint
Dim PptApp As PowerPoint.Application
Dim PptDoc As PowerPoint.Presentation
Dim Diapo As PowerPoint.Slide
Dim NbShpe As Integer
'Paramètres des Logos
Dim Nom_Image As String
Dim Nom_Logo As String
'Paramètres des Graphiques
Dim Nom_Feuille As String
Dim Nom_Graphique As String
Dim Numero_Slide As Integer
Dim Slide_Graph As String
Dim Pos_Hz As Integer
Dim Pos_Vt As Integer
Dim Pos_Ht As Integer
Dim Pos_Lg As Integer
Sub ExportXlsxPptx()
Application.CutCopyMode = False
'Ouverture Maquette Powerpoint
Set PptApp = New PowerPoint.Application
PptApp.Visible = True
Set PptDoc = PptApp.Presentations.Open(ThisWorkbook.Path & "\" & "Maquette 2016 vs 2015.pptx")
Workbooks("Données 2016 vs 2015").Activate
'Slide 12
Call Ajout_Graph("1 - Profil", "Graphique 1", 12, 111, 304, 119, 88)
Call Ajout_Graph("1 - Profil", "Graphique 2", 12, 111, 304, 416, 88)
Call Ajout_Graph("1 - Profil", "Graphique 3", 12, 111, 304, 119, 280)
'Slide 13
Call Ajout_Graph("2 - Profil - PRATIQUANTS", "Graphique 1", 13, 152, 322, -29, 35)
Call Ajout_Graph("2 - Profil - PRATIQUANTS", "Graphique 2", 13, 122, 259, 392, 63)
PptDoc.SaveAs Filename:=ThisWorkbook.Path & "\" & "En Cours 2016 vs 2015.pptx"
PptDoc.Close
PptApp.Quit
End Sub
Sub Ajout_Graph(Nom_Feuille, Nom_Graphique, Numero_Slide, Pos_Ht, Pos_Lg, Pos_Hz, Pos_Vt)
'Nom feuille / Nom Graphique / Numéro Slide / Hauteur / Largeur / Horizontal / Vertical
Application.CutCopyMode = False
ActiveWorkbook.Sheets(Nom_Feuille).Activate
ActiveSheet.ChartObjects(Nom_Graphique).Copy
PptDoc.Slides(Numero_Slide).Shapes.PasteSpecial ppPasteEnhancedMetafile
NbShpe = PptDoc.Slides(Numero_Slide).Shapes.Count
With PptDoc.Slides(Numero_Slide).Shapes(NbShpe)
.Left = Pos_Hz 'position horizontale dans le slide
.Top = Pos_Vt 'position verticale dans le slide
.Height = Pos_Ht 'hauteur image
.Width = Pos_Lg 'largeur image
End With
End Sub |
Partager