3

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
3
  • Does the compiler autocomplete the .BreakLinks command when you type it? Have you activated the powerpoint Reference in this project (Microsoft Powerpoint xx.x Object Library)? The latter is sometimes forgotten as a lot of the functionality is also in the Office library, but not all... Commented Dec 12, 2012 at 12:54
  • Yes, it is autocompleted. But there is a failure message during execution regarding this line. The Powerpoint reference is also activated. Commented Dec 12, 2012 at 13:02
  • 1
    Can you please also post the failure message in your question. To know the exact problem enables the community to solve it! Commented Dec 12, 2012 at 13:11

1 Answer 1

2

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
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.