+ Reply to Thread
Results 1 to 2 of 2

Excel VBA to open PowerPoint Update Links, Save and Close Powerpoint with a new file name

  1. #1
    Registered User
    Join Date
    11-10-2015
    Location
    Philadelphia, US
    MS-Off Ver
    2013
    Posts
    1

    Excel VBA to open PowerPoint Update Links, Save and Close Powerpoint with a new file name

    Hi Everyone,

    I have been working on this macro for a few days and am stuck. This is what I am trying to accomplish.

    1. I need a specific PowerPoint presentation to open when I run a macro in excel
    2. Update all of the links within the PowerPoint
    3. Save the PowerPoint as another name.
    4. Close the PowerPoint.

    My end goal is to set up a loop to go through and update the powerpoint based on 15 different Business Units and save it as a different name each time the Power is updated.

    I have accomplished steps 1 and 2. I cannot figure out steps 3 and 4, how to save and close the powerpoint. Any help will be appreciated.

    Here is the code I am currently using. The last 2 lines of code are what is failing. I have also tried ActivePresentation to save and close and that is not working either...

    All help is appreciated.

    Dim pApp As Object
    Dim pPreso As Object
    Dim pSlide As Object
    Dim sPreso As String

    sPreso = "S:\MasterPowerPointv2.pptx"

    On Error Resume Next
    Set pApp = GetObject(, "PowerPoint.Application")

    If Err.Number <> 0 Then
    Set pApp = CreateObject("PowerPoint.Application")
    pApp.Visible = True
    End If

    On Error Resume Next
    Set pPreso = pApp.Presentations(sPreso)

    If Err.Number <> 0 Then
    Set pPreso = pApp.Presentations.Open(Filename:=sPreso)
    End If
    On Error GoTo 0
    pPreso.UpdateLinks

    On Error GoTo 0
    pPreso.activepresentation.SaveAs "C:\test.pptx"
    pPreso.Quit

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Excel VBA to open PowerPoint Update Links, Save and Close Powerpoint with a new file

    As for renaming the PP presentation, do that before even opening the file. Make a copy with the name you want, and work with it.
    Please Login or Register  to view this content.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [VBA Chanllenge] in PowerPoint. Open/Close excel file in linked graph
    By jackyboris in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-15-2016, 12:07 PM
  2. Replies: 6
    Last Post: 08-18-2015, 06:39 AM
  3. User Form - in Powerpoint - Update Links from Excel
    By gastonpresente in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-04-2015, 09:36 AM
  4. [SOLVED] Update powerpoint links from Excel
    By Kramxel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-22-2013, 05:18 AM
  5. Replies: 1
    Last Post: 03-27-2013, 08:33 AM
  6. Replies: 13
    Last Post: 01-11-2013, 04:46 PM
  7. Update Links in PowerPoint from Excel
    By cassy01 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-22-2007, 06:59 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1