AW: Excel - PowerPoint - drei Diagramme auf eine Folie
19.08.2016 09:31:59
Bonduca
Hallo,
leider bin ich in VBA in Verbindung mit PPT kompletter Laie und konnte den Code nur so gestalten:
Für Objekt 1
Sub DiagrammExport()
Dim ppApp As PowerPoint.Application
Dim i As Integer
Dim xlChart As Excel.Chart
ActiveWorkbook.Sheets("Diagramm").ChartObjects(1).Copy
'PPObjekt installieren
Set ppApp = New PowerPoint.Application
'Kopieren der Grafik
With ppApp
'PP sichtbar machen
.Visible = True
.Activate
With .ActivePresentation
.Slides(1).Shapes.Paste
With .Slides(1).Shapes.Range
.Fill.Transparency = 0#
.Fill.Transparency = 0#
.Left = 50#
.Top = 130#
End With
End With
End With
Set ppApp = Nothing
End Sub
Für Objekt 2
Sub DiagrammExport2()
Dim ppApp As PowerPoint.Application
Dim i As Integer
Dim xlChart As Excel.Chart
ActiveWorkbook.Sheets("Diagramm").ChartObjects(2).Copy
'PPObjekt installieren
Set ppApp = New PowerPoint.Application
'Kopieren der Grafik
With ppApp
'PP sichtbar machen
.Visible = True
.Activate
With .ActivePresentation
.Slides(1).Shapes.Paste
With .Slides(1).Shapes.Range
.Fill.Transparency = 0#
.Fill.Transparency = 0#
.Left = 250#
.Top = 130#
End With
End With
End With
Set ppApp = Nothing
End Sub
Die beiden Diagramme erscheinen auf der 1. Folie in PPT (wenn PPT geöffnet ist).
Ich möchte jetzt das 1. Diagramm ganz links auf der PPT Folie und das 2. Diagramm ganz rechts positionieren. Warum klappt es nicht?
Danke für eure Hilfe!
Leider funktioniert es noch nicht.