使用 VBA 在 Powerpoint 中刷新来自 Excel 的嵌入图表
Refresh Embedded Chart from Excel in Powerpoint by using VBA
我创建了以下代码,但我需要包含以刷新幻灯片 9 中的图表。
Set oPPApp = CreateObject(, "PowerPoint.Application")
With oPPApp
.Presentations.Open "C:\Users\jmarqu7\Documents\PPT FTL NAR\Carrier Meeting Template - FTL - Test.pptx", Untitled:=msoTrue
With .ActivePresentation
.UpdateLinks
.SaveAs Filename:="C:\Users\jmarqu7\Documents\PPT FTL NAR\" & NewCat & ".pptx"
.Close
End With
End With
你能帮我看看我需要使用哪个命令吗?
谢谢
您可以使用 Shape 对象的 LinkFormat 属性 的 Update 方法。例如,假设 pptPres 引用您的演示文稿,并且图表位于第 9 号幻灯片上,并且它被称为 "Chart 1",请尝试...
pptPres.Slides(9).Shapes("Chart 1").LinkFormat.Update
我创建了以下代码,但我需要包含以刷新幻灯片 9 中的图表。
Set oPPApp = CreateObject(, "PowerPoint.Application")
With oPPApp
.Presentations.Open "C:\Users\jmarqu7\Documents\PPT FTL NAR\Carrier Meeting Template - FTL - Test.pptx", Untitled:=msoTrue
With .ActivePresentation
.UpdateLinks
.SaveAs Filename:="C:\Users\jmarqu7\Documents\PPT FTL NAR\" & NewCat & ".pptx"
.Close
End With
End With
你能帮我看看我需要使用哪个命令吗?
谢谢
您可以使用 Shape 对象的 LinkFormat 属性 的 Update 方法。例如,假设 pptPres 引用您的演示文稿,并且图表位于第 9 号幻灯片上,并且它被称为 "Chart 1",请尝试...
pptPres.Slides(9).Shapes("Chart 1").LinkFormat.Update