PowerPoint通过Excel VBA断开链接



我正在尝试使用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

感谢您的回答。

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

PPT.ActivePresentation.Slides(i).Shapes(s).LinkFormat.BreakLink

最新更新