Sub Export_Ppt()
'necessite d'activer la reference Microsoft Powerpoint Object Library
Dim PPT As PowerPoint.Application
Dim PptDoc As PowerPoint.Presentation
Dim NbShpe As Byte
Dim Rep As Byte
Set PPT = CreateObject("Powerpoint.Application") 'creation session PowerPoint
Set PptDoc = PPT.Presentations.Add 'Création fichier pptx
Dim Feuille As Worksheet, I As Integer, J As Integer, NbreGraphiques As Integer
I = 1
For Each Feuille In ThisWorkbook.Worksheets
NbreGraphiques = Feuille.Shapes.Count
For J = 1 To NbreGraphiques
If Feuille.Shapes(J).Name <> "Scroll Bar 1" And Feuille.Shapes(J).Name <> "Oval 9" Then
PptDoc.Slides.Add I, ppLayoutBlank
Feuille.Shapes(J).Copy
With PptDoc.Slides(I).Shapes
.Paste
.Range.Align msoAlignCenters, msoTrue
.Range.Align msoAlignMiddles, msoTrue
End With
I = I + 1
End If
Next J
Next Feuille
PptDoc.SaveAs ThisWorkbook.Path & "/Présentation1.pptx", ppSaveAsOpenXMLPresentation 'sauvegarder le nouveau fichier
PptDoc.Close
Set PptDoc = Nothing
PPT.Quit
Set PPT = Nothing
ThisWorkbook.Activate
Rep = MsgBox("Voulez-vous afficher la présentation ?", vbYesNo)
If Rep = vbYes Then
Set PPT = CreateObject("Powerpoint.Application") 'creation session PowerPoint
Set PptDoc = PPT.Presentations.Open(ThisWorkbook.Path & "/Présentation1.pptx") 'ouverture fichier ppt
End If
End Sub