3

我正在尝试使用 VBA 脚本通过 Excel 更新带有嵌入图表的 PowerPoint 演示文稿。这适用于我的代码。问题是我还希望 - 在图表更新后 - 断开/删除指向 Excle 工作表的链接。

代码示例还显示了我的代码以及不起作用的行。

任何建议或解决方案将不胜感激!

Function RefreshPPT()
Set PPT = CreateObject("PowerPoint.Application")
PPT.Visible = True
PPT.Presentations.Open "Name.pptx", Untitled:=msoTrue
PPT.ActivePresentation.UpdateLinks
PPT.ActivePresentation.BreakLinks ------ this line doesn´t work
PPT.ActivePresentation.SaveAs Filename:="Name2.pptx"
PPT.Quit
Set PPT = Nothing
End Function
4

1 回答 1

2

感谢您的回答。

我想我已经解决了问题:breakline 命令的语法错误。我必须直接处理幻灯片和形状:

PPT.ActivePresentation.Slides(i).Shapes(s).LinkFormat.BreakLink
于 2012-12-12T14:07:48.700 回答