powerpoint通过excel vba打破链接 [英] powerpoint breaking links via excel vba

查看:169
本文介绍了powerpoint通过excel vba打破链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am trying to update a PowerPoint Presentation with embedded charts via Excel by using a VBA script. This works fine with my code. The Problem is that I also want - after the charts have been updated - to break/remove the links to the Excle worksheet.

代码示例显示我的代码也包含不起作用的行。

The code example shows my code also with the line that doesn´t work.

任何建议或解决方案非常感谢!

Any suggestion or solution would be highly appreciated!

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命令的语法错误。
我必须直接处理幻灯片和形状:

I think I have solved the problem: The syntax of the breakline command was wrong. I had to address the slides and shapes directly:

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

这篇关于powerpoint通过excel vba打破链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆