Hey Everyone,
so i have the following code in order to open a powerpoint presentation which i have embedded into excel, save that powerpoint under a new name to a filepath and then open that powerpoint (so that the new saved powerpoint copy is edited and not the embedded object)
This worked fine in another project, but now all of a sudden I cant close the presentation after I saved a copy of the template... I updated my Office-Version inbetween projects, anyhting to do with that maybe?
Thanks for the help and any tips are greatly appreciated
cheers
so i have the following code in order to open a powerpoint presentation which i have embedded into excel, save that powerpoint under a new name to a filepath and then open that powerpoint (so that the new saved powerpoint copy is edited and not the embedded object)
VBA Code:
Sub Erstelle_PowerPoint()
Application.ScreenUpdating = False 'Soll wohl das Übertragen schneller machen durch Deaktivieren von ScreenUpdating
Application.DisplayAlerts = False
Application.Calculation = xlManual
Application.CutCopyMode = False 'Clipboard leeren
'New PP Instance
Set PPapp = New PowerPoint.Application
PPapp.Visible = msoTrue
MsgBox ("Please pick a filepath to save to."), vbSystemModal
With Application.FileDialog(msoFileDialogFolderPicker)
.AllowMultiSelect = False
.Show
PPdateipfad = .SelectedItems.Item(1) 'String to hold filepath
End With
Dim oEmbFile As Object
Application.DisplayAlerts = False
Set oEmbFile = ThisWorkbook.Sheets("PP Export").OLEObjects("PP vorlage") 'Opens "PP vorlage", the embedded PP-Presentation template
oEmbFile.Verb Verb:=xlOpen
Set oEmbFile = Nothing
Set PPpres = PPapp.ActivePresentation
'Save as new presentation
PPpres.SaveAs (PPdateipfad + "\TestLink-Report.pptx")
PPpres.Close 'GETTING ERROR HERE "Presentation_" unknown member failed, supposed to close here and then reopen the just saved copy so I dont edit the template but the new copy
Application.Wait (Now + TimeValue("00:00:02"))
Set PPpres = PPapp.Presentations.Open(PPdateipfad & "\TestLink-Report.pptx", msoTrue)
Application.Wait (Now + TimeValue("00:00:02"))
End Sub
This worked fine in another project, but now all of a sudden I cant close the presentation after I saved a copy of the template... I updated my Office-Version inbetween projects, anyhting to do with that maybe?
Thanks for the help and any tips are greatly appreciated
cheers