简体   繁体   中英

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")
For Each sld In ActivePresentation.Slides

    For Each sh In sld.Shapes

        If sh.Type = msoLinkedOLEObject Then

            sh.LinkFormat.Update

        End If

    Next

Next

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM