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
| Sub Test_WS()
'nécessite d'activer la référence Microsoft Powerpoint Object Library
Dim PPT As PowerPoint.Application, PptDoc As PowerPoint.Presentation
Dim NbShpe As Byte, i As Integer, WS As Worksheet
Set PPT = CreateObject("Powerpoint.Application")
PPT.Visible = True 'l'application sera visible
Set PptDoc = PPT.ActivePresentation ' PPT.Presentations.Open("I:\DRH\EFFECTIF\Pôles-DRH\Test.ppt")
'Les plages de cellules des 3 premières feuilles
i = 1
For Each WS In ThisWorkbook.Worksheets
If WS.Name <> "Absenteisme-LD-LM" And WS.Name <> "Compteurs-82-83" And WS.Name <> "Mensus-2007-2008" And WS.Name <> "Type_poles" And WS.Name <> "MENU" Then
WS.Range("B2:I37").Copy
PptDoc.Slides(i + 1).Shapes.Paste ppPasteEnhancedMetafile
NbShpe = PptDoc.Slides(i + 1).Shapes.Count
With PptDoc.Slides(i + 1).Shapes(NbShpe)
'.Name = "NomForme"
.Left = 100
.Top = 50
.Height = 200
.Width = 350
End With
i = i + 1
End If
Next WS
'PptDoc.Save 'sauvegarder les modifications
'PptDoc.Close 'fermer le document ppt
'PPT.Quit 'fermer l'application powerPoint
End Sub |
Partager