Excel-Graphiken auf einer PPP exportieren
10.12.2007 15:47:17
Andante
Hi...ein Freund von mir hat folgenden Code in VBA geschrieben und dient dazu alle möglichen Excel-Graphiken in einer Power Point Presentation zu exportieren.
Aber jedes mal,dass ich eine Graphik exportiere öffnet mir eine neue PPP !
Aber ich will, dass die Graphiks in verschiedene Slides in nur EINE PPP...kommen!
Kann mir da jemand helfen?
Auf dieser Zeile sollte man das ändern können!
' Set s1 = ppApp.ActivePresentation.Slides.Add(Index:=NumberDiagramm, Layout:=ppLayoutBlank
Ciao ciao
--------------------------------------------------------------------------
Hier the code:
Public Sub Export(ByVal SheetString As String, ByVal Schnittstelle As String, ByVal _
Export_ThisChart As String)
Dim ppApp As Object
Dim ppPres As String
ppPres = Schnittstelle
Set ppApp = CreateObject("Powerpoint.Application")
With ppApp
'.Visible = True
'.WindowState = 1
.Activate
End With
Set ppFile = ppApp.Presentations.Open(ppPres)
ActiveWorkbook.Worksheets(SheetString).ChartObjects(Export_ThisChart + 1).Activate
ActiveChart.ChartArea.Copy
ppApp.ActivePresentation.Slides(1).Shapes.Paste
End Sub
Public Sub ExportII(ByVal NumberDiagramm As Long, ByVal SheetString As String, ByVal _
Schnittstelle As String, ByVal Export_ThisChart As String)
Dim idx As Long
idx = 1
Dim ppApp As Object
Dim ppPres As String
Dim sl As Object
ppPres = Schnittstelle
Set ppApp = CreateObject("Powerpoint.Application")
With ppApp
'.Visible = True
'.WindowState = 1
.Activate
End With
Set ppFile = ppApp.Presentations.Open(ppPres)
ActiveWorkbook.Worksheets(SheetString).ChartObjects(Export_ThisChart + 1).Activate
ActiveChart.ChartArea.Copy
If NumberDiagramm > 1 Then
' Set s1 = ppApp.ActivePresentation.Slides.Add(Index:=NumberDiagramm, Layout:=ppLayoutBlank) _
End If
ppApp.ActivePresentation.Slides(NumberDiagramm).Shapes.Paste
End Sub