Bonjour,
SVP, je rencontre un petit problème, je copie quelque cellules à partir d'excel vers une présentation PowerPoint.
et quand l’exécution arrive à cette ligne ".Slides(5).Shapes.Paste" sa plante et je sais pas pourquoi
voice le code:
Sub pppt()
Dim PptApp As PowerPoint.Application
Dim PptDoc As PowerPoint.Presentation
Dim Diapo As PowerPoint.Slide
Dim Sh As PowerPoint.Shape
Dim i, a As Integer
Dim p As Integer
a = 0
i = 1
p = 3
Dim Template As Variant
Template = Application.GetOpenFilename
Set PptApp = CreateObject("PowerPoint.Application")
PptApp.Visible = msoTrue
Set PptDoc = PptApp.Presentations.Open(Template)
With PptDoc
'*****Slide 1*****
Set Sh = .Slides(1).Shapes.AddLabel(Orientation:=msoTextOrientationHorizontal, _
Left:=320, Top:=440, Width:=10, Height:=10)
Sh.TextFrame.TextRange.Text = Feuil1.TextBox1
Sh.TextFrame.TextRange.Font.Size = 20
Sh.TextFrame.TextRange.Font.Bold = msoTrue
Set Sh = .Slides(1).Shapes.AddLabel(Orientation:=msoTextOrientationHorizontal, _
Left:=130, Top:=57, Width:=10, Height:=10)
Sh.TextFrame.TextRange.Text = " REVUE LIMITEE DU SYSTEME D'INFORMATION DANS LE CADRE" & vbCrLf & " DU COMMISSARIAT AU COMPTE DE " & Feuil1.TextBox1
Sh.TextFrame.TextRange.Font.Size = 20
Sh.TextFrame.TextRange.Font.Bold = msoTrue
'*****************
'*****Slide 5*****
p = 17
While Not IsEmpty(Sheets("Paramétre").Cells(p, 3))
p = p + 1
Wend
p = p - 1
Feuil8.Range("C17:E" & p).Copy
.Slides(5).Shapes.Paste 'Ligne de problème
End sub
Merci pour vos réponse.