Consulting

Results 1 to 5 of 5

Thread: Access Breaklink in PPTx

  1. #1
    VBAX Regular
    Joined
    May 2011
    Posts
    21
    Location

    Access Breaklink in PPTx

    Can anyone show me how to access the breaklinks in these two shapes?
    msoEmbeddedOLEObject
    ActivePresentation.Slides.Shapes.OLEFormat.Object.Worksheets(1).BreakLink

    msoChart
    ActivePresentation.Slides.Shapes.Chart.ChartData.BreakLink

    Neither of these seems to work or are they incomplete?
    Thanks in advance.

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    Breaklink is a method of the Shapes LinkFormat property.

    It's very unclear from your code what shape you are targetting. If Shape(3) was a linked object you could use:

    [vba]Dim oshp As Shape
    Set oshp = ActivePresentation.Slides(1).Shapes(3)
    If oshp.Type = msoLinkedOLEObject Then _
    oshp.LinkFormat.BreakLink[/vba]
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  3. #3
    VBAX Regular
    Joined
    May 2011
    Posts
    21
    Location
    Thanks John.
    The first one is an msoEmbeddedOLEObject (embedded excel object), not a linked object and the second is a chart created in PowerPoint (msoChart).

    In the chart object, I have links in the datasheet that I would like to break and Excel object has a chart tab and a sheet1 tab that contains links I need to break.

    I know what I am doing is a bit unorthodox, but it is what the client wants.

    Since it is not a linked object, your example doesn't affect it.

    Dim oshp As Shape  
    Set oshp = ActivePresentation.Slides(1).Shapes(3)  
    If oshp.Type = msoEmbeddedOLEObject Then 
    breaklink????
    
    or 
    
    Dim oshp As Shape  
    Set oshp = ActivePresentation.Slides(1).Shapes(3)  
    If oshp.Type = msoChart Then 
    breaklink????

  4. #4
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    If it's not a linked object you can't break links (To the best of my knowledge)
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  5. #5
    VBAX Regular
    Joined
    May 2011
    Posts
    21
    Location
    You can if you do it manually.
    For msoChart object
    Right click on chart
    edit data
    then in the data sheet choose data > edit links>break links

    For the msaEmbeddedOLEObject
    double click on object to activate it
    select sheet1
    then choose data > edit links>break links

    Just can't do this in VBA
    I can copy and paste as value, but that does mess with the chart format sometimes.

    Dim oSh As Shape
    Dim oSl As Slide
    Dim oSheet As Object


    For Each oSl In ActivePresentation.Slides
    For Each oSh In oSl.Shapes

    ActiveWindow.View.GotoSlide oSl.SlideIndex
    If oSh.Type = msoEmbeddedOLEObject Then

    ' oSh.OLEFormat.Activate

    With oSh.OLEFormat.Object

    .Worksheets(1).Cells.Copy
    .Worksheets(1).Cells.PasteSpecial Paste:=-4163 ' I don't know why this works but it does
    .Sheets(1).Activate
    End With

    ActiveWindow.Selection.Unselect
    ActiveWindow.View.GotoSlide oSl.SlideIndex

    End If
    Next

    Next

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •