繁体   English   中英

打开 Powerpoint 演示文稿并更新 VBA 中的 Excel 链接

[英]Open a Powerpoint Presentation and update the Excel links in VBA

我必须根据 Excel 中的数据自动生成报告。 该报告已经设置了链接(使用“粘贴为链接”创建的文本框),并且每次运行代码时都需要更新。 我有以下代码,但它不会更新链接。 这怎么可能?

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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