Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-22-2016, 10:17 AM
Dr. Demento Dr. Demento is offline VBA Break links of copied range Windows 7 32bit VBA Break links of copied range Office 2010 32bit
Novice
VBA Break links of copied range
 
Join Date: Nov 2015
Location: Skipping stones off Charon's Ferry
Posts: 7
Dr. Demento is on a distinguished road
Default 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
Reply With Quote
  #2  
Old 11-22-2016, 10:31 AM
JohnWilson JohnWilson is offline VBA Break links of copied range Windows 7 64bit VBA Break links of copied range Office 2010 32bit
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,912
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

Chris's code should break links to ranges so not sure I understand.
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote
  #3  
Old 11-25-2016, 06:51 AM
Dr. Demento Dr. Demento is offline VBA Break links of copied range Windows 7 32bit VBA Break links of copied range Office 2010 32bit
Novice
VBA Break links of copied range
 
Join Date: Nov 2015
Location: Skipping stones off Charon's Ferry
Posts: 7
Dr. Demento is on a distinguished road
Default

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
Reply With Quote
  #4  
Old 11-25-2016, 11:25 AM
JohnWilson JohnWilson is offline VBA Break links of copied range Windows 7 64bit VBA Break links of copied range Office 2010 32bit
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,912
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

Are they on the larger master or one of the custom layouts?
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote
  #5  
Old 11-25-2016, 11:58 AM
Dr. Demento Dr. Demento is offline VBA Break links of copied range Windows 7 32bit VBA Break links of copied range Office 2010 32bit
Novice
VBA Break links of copied range
 
Join Date: Nov 2015
Location: Skipping stones off Charon's Ferry
Posts: 7
Dr. Demento is on a distinguished road
Default

Not sure; the master contains 12 master templates but one of them is customized title slide and contains the two linked objects.
Reply With Quote
  #6  
Old 11-26-2016, 05:57 AM
JohnWilson JohnWilson is offline VBA Break links of copied range Windows 7 64bit VBA Break links of copied range Office 2010 32bit
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,912
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

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
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote
  #7  
Old 11-28-2016, 05:49 AM
Dr. Demento Dr. Demento is offline VBA Break links of copied range Windows 7 32bit VBA Break links of copied range Office 2010 32bit
Novice
VBA Break links of copied range
 
Join Date: Nov 2015
Location: Skipping stones off Charon's Ferry
Posts: 7
Dr. Demento is on a distinguished road
Default

That totally did the trick, John. Thanks so much!!!
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Break links of copied range 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

Other Forums: Access Forums

All times are GMT -7. The time now is 10:11 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft