Consulting

Results 1 to 2 of 2

Thread: How to save PP as pptx instead of ppt from Excel VBA

  1. #1

    How to save PP as pptx instead of ppt from Excel VBA

    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"
    Last edited by xcelintern; 11-17-2016 at 06:25 AM. Reason: solved

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,954
    Location
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •