Jon Smith
Jon Smith

Reputation: 93

Open a Powerpoint Presentation and update the Excel links in VBA

I have to produce a report automatically based on data in Excel. The report has links (text boxes created using "paste as link") already set up and that need updating every time the code is run. I have the below code but it does not update the links. How is this possible?

Dim PowerPointApp  As PowerPoint.Application
Set PowerPointApp = CreateObject("PowerPoint.Application")
Dim PowerPoint As PowerPoint.Presentation
PowerPointApp.Presentations.Open ("X:\Intranet\Templates\Investment Proposal Templates\IP Normal Template.pptx")

Upvotes: 0

Views: 399

Answers (1)

Jon Smith
Jon Smith

Reputation: 93

For Each sld In ActivePresentation.Slides

    For Each sh In sld.Shapes

        If sh.Type = msoLinkedOLEObject Then

            sh.LinkFormat.Update

        End If

    Next

Next

Upvotes: 3

Related Questions