我正在尝试使用 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
最佳答案
感谢您的回答。
我想我已经解决了这个问题:breakline命令的语法错误。 我必须直接处理幻灯片和形状:
PPT.ActivePresentation.Slides(i).Shapes(s).LinkFormat.BreakLink
关于excel - Powerpoint通过Excel VBA断开链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13840166/