PDA

View Full Version : How to save PP as pptx instead of ppt from Excel VBA



xcelintern
11-17-2016, 05:35 AM
Excel 2010
PP 2010


Hi guys,

I have a rather simple question that on of you might hopefully be able to answer. Im using the following code to save a presentation that i just opened and updated from Excel VBA.

From this code PP is saving them as ppt while I would like to save them as pptx, for compatibility reasons.


Dim FName As String
Dim FPath As String

'Path to save in'
FPath = "M:\random\"
'name from excel sheet'
FName = Sheets("ge aktuell").Range("A1").Text


pApp.ActivePresentation.SaveAs FPath & FName & " Geschäftsentwicklung", 1

How could i simply modify this to save as pptx instead of ppt.

thanks in advance


Edit: Problem solved


pApp.ActivePresentation.SaveAs FPath & FName & " Geschäftsentwicklung" & ".pptx"

Kenneth Hobs
11-17-2016, 07:10 AM
Should you want to use SaveCopyAs(), it is the same.

'https://msdn.microsoft.com/en-us/library/office/ff744735.aspx
Sub Main()
'File extensions not needed if fileformat is set.
ActivePresentation.SaveCopyAs "c:\temp\ken.pptx", ppSaveAsDefault, msoTrue
'ActivePresentation.SaveCopyAs "c:\temp\ken.ppsx", ppSaveAsOpenXMLShow, msoTrue
'ActivePresentation.SaveCopyAs "c:\temp\ken.xml", ppSaveAsXMLPresentation, msoTrue
'ActivePresentation.SaveCopyAs "c:\temp\ken.pptm", ppSaveAsOpenXMLPresentationMacroEnabled, msoTrue
End Sub