Excel nach PowerPoint
03.08.2023 10:34:17
Heidi Martin
gibt es die Möglichkeit mit diesem Code auch ein Bild, welches in Excel fest in einer Zelle ist, nach PowerPoint zu exportieren?
Hier ist mein jetziger Code:
Sub Test()
Dim pptApp As Object 'PowerPoint.Application
Dim pptPres As Object 'PowerPoint.Presentation
Dim strPfad As String, strPOTX As String, pptVorlage As String
strPOTX = XXX.potx"
'Gleicher Pfad wie diese Datei
strPfad = ThisWorkbook.Path
If Right(strPfad, 1) > "\" Then strPfad = strPfad & "\"
pptVorlage = strPfad & strPOTX
Set pptApp = CreateObject("PowerPoint.Application")
pptApp.Presentations.Open Filename:=pptVorlage, untitled:=msoTrue
Set pptPres = pptApp.ActivePresentation
With pptPres
With .Slides(1)
.Shapes("Title").TextFrame.TextRange.Characters.Text = Range("rng_Title").Value
.Shapes("Customer").TextFrame.TextRange.Characters.Text = Range("rng_Customer").Value
.Shapes("Location").TextFrame.TextRange.Characters.Text = Range("rng_Location").Value
.Shapes("Year").TextFrame.TextRange.Characters.Text = Range("rng_Year").Value
.Shapes("Energization").TextFrame.TextRange.Characters.Text = Range("rng_Energization").Value
.Shapes("Challenge").TextFrame.TextRange.Characters.Text = Range("rng_Challenge").Value
.Shapes("Scope").TextFrame.TextRange.Characters.Text = Range("rng_Scope").Value
.Shapes("Solution").TextFrame.TextRange.Characters.Text = Range("rng_Solution").Value
.Shapes("Author | Department").TextFrame.TextRange.Characters.Text = Range("rng_Author").Value
End With
.SaveAs strPfad & Range("rng_Title") & ".pptx"
.Close
End With
pptApp.Quit
End Sub