Grüßt euch Leute,
ich möchte gerne die Diagramme von Excel nach PowerPoint kopieren via Vba.
Allerdings stehe ich jetzt vor dem Problem, dass ich zwei Diagrammblätter habe und diese zwei Diagramme müssten auf eine Folie in der PPT-Vorlage, nur weiße ich nicht wie das gehen soll.
mein aktueller Code lautet.
Sub CreatePPT()
Dim ppt As Object
Dim oPPT As PowerPoint.Application
Dim oPrs As PowerPoint.Presentation
Dim oSld As PowerPoint.Slide
Dim oPct As PowerPoint.Shape
Dim oTxt As PowerPoint.Shape
Dim sPath As String
sPath = Application.DefaultFilePath & "/xl2ppt.ppt"
Set oPPT = CreateObject("PowerPoint.Application")
Set oPrs = oPPT.Presentations.Open("X:")
'Öffnet die PPT-Vorlage
Sheets("NAME").Select
ActiveChart.ChartArea.Copy
Set oSld = oPrs.Slides(1)
Set oPct = oSld.Shapes.Paste(1)
Set oPct = Nothing
Set oTxt = Nothing
Set oSld = Nothing
Set oPrs = Nothing
Set oPPT = Nothing
Application.Wait Now + TimeSerial(0, 0, 3)
Set ppt = GetObject(sPath)
End Sub
Wie könnte ich die Diagramme auch noch skalieren?
Viele Grüße und schon mal ein Dankeschön
Gianni |