#1
|
|||
|
|||
VBA Break links of copied range
I have a pptx with both embedded/linked Excel charts and ranges. Chris Newman provides a nice solution to break the links with the charts using Slides.Shapes (link). However, I'm still left with the linked ranges and I don't know enough about PowerPoint objects to do this on my own.
Could someone give me some pointers on how to programmatically break the links of embedded copied ranges? Thanks y'all. Dr. D |
#2
|
|||
|
|||
Chris's code should break links to ranges so not sure I understand.
|
#3
|
|||
|
|||
On more careful examination, the two links that remain unbroken by Chris' code are on the Slide Master. When I right-click them, they are listed as Linked Worksheet Objects and point to two cells with dates in them.
When I added this code, it neither listed the objects nor deleted the links. Thoughts?? Code:
For Each shp In ActivePresentation.SlideMaster.Shapes On Error Resume Next Debug.Print shp.Parent.Name & " | " & shp.Name shp.LinkFormat.BreakLink On Error GoTo 0 Next shp |
#4
|
|||
|
|||
Are they on the larger master or one of the custom layouts?
|
#5
|
|||
|
|||
Not sure; the master contains 12 master templates but one of them is customized title slide and contains the two linked objects.
|
#6
|
|||
|
|||
I'm guessing you have one slidemaster with 12 custom layouts.
If so try this Code:
Sub BreakAllLinks() Dim shp As Shape Dim sld As Slide Dim ocust As CustomLayout 'Loop Through Each Slide in ActivePresentation For Each sld In ActivePresentation.Slides For Each shp In sld.Shapes On Error Resume Next shp.LinkFormat.BreakLink Next shp Next sld 'Loop through layouts For Each ocust In ActivePresentation.Designs(1).SlideMaster.CustomLayouts For Each shp In ocust.Shapes On Error Resume Next shp.LinkFormat.BreakLink Next shp Next ocust End Sub |
#7
|
|||
|
|||
That totally did the trick, John. Thanks so much!!!
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Touching Header range with VBA forces a page break | jojo77 | Word VBA | 2 | 11-27-2016 03:25 PM |
How to break Links to FIles in visual basic? | Asinkan | PowerPoint | 0 | 11-15-2012 03:08 AM |
Break Links to Files automaticaly | Asinkan | PowerPoint | 0 | 11-14-2012 08:15 AM |
MS 2003 cross reference links break down | mkj256 | Word | 0 | 08-24-2010 08:46 AM |
Break Links with Excel | streng | Word | 0 | 06-29-2009 02:43 AM |