Reputation: 51
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
Upvotes: 3
Views: 6585
Reputation: 51
thanks for the answers.
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
Upvotes: 2