| VBA-Beispiel 081 | |
|
|
|
Grafiken exportieren von Excel nach PowerPoint |
|
|
Kopiert alle Grafiken einer Exceltabelle in eine neue PowerPoint-Datei. Für jede Grafik wird einen neue Folie angelegt. Hinweis: Damit die Prozedur funktioniert, müssen Sie im Editor unter Extras/Verweise einen Verweis setzen:
|
|
|
Sub jede_Grafik_nach_PowerPoint() 'Extras - Verweise: Microsoft PowerPoint x.x Object Library Dim Grafik As Shape Dim PP As PowerPoint.Application Dim PP_Datei As PowerPoint.Presentation Dim PP_Folie As PowerPoint.Slide On Error GoTo Hell Set PP = CreateObject("Powerpoint.Application") With PP .Visible = True .Presentations.Add End With Set PP_Datei = PP.ActivePresentation For Each Grafik In ActiveSheet.Shapes 'neue Folie einfügen PP.ActivePresentation.Slides.Add 1, ppLayoutBlank Set PP_Folie = PP_Datei.Slides(1) 'kopieren Grafik.CopyPicture 'einfügen PP_Folie.Shapes.Paste Next Set PP_Folie = Nothing Set PP_Datei = Nothing Set PP = Nothing Exit Sub Hell: Set PP_Folie = Nothing Set PP_Datei = Nothing Set PP = Nothing MsgBox "FehlerNr.: " & Err.Number & vbNewLine & vbNewLine _ & "Beschreibung: " & Err.Description _ , vbCritical, "Fehler" End Sub |
|
|
Download: vba081.zip |
|
|
relevante Links: |
|
| |