代码之家  ›  专栏  ›  技术社区  ›  Jon Smith

如何在VBA中打开Powerpoint演示文稿并更新excel链接

  •  0
  • Jon Smith  · 技术社区  · 4 年前

    我必须根据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")
    
    0 回复  |  直到 4 年前
        1
  •  3
  •   Dale K    4 年前
    For Each sld In ActivePresentation.Slides
    
        For Each sh In sld.Shapes
    
            If sh.Type = msoLinkedOLEObject Then
    
                sh.LinkFormat.Update
    
            End If
    
        Next
    
    Next