Consulting

Results 1 to 3 of 3

Thread: The Wondrous World Wherein Shapes Change Shapes

  1. #1
    VBAX Regular
    Joined
    Feb 2012
    Posts
    41
    Location

    The Wondrous World Wherein Shapes Change Shapes

    In PP2010 I have been working on an App that updates "Template Slides" from an Excel spreadsheet. A "control slide" at the beginning of a deck of template slides figures out what slides are in the deck and then works through and updates them one-by-one. Everything was working fine with each of the single template slides, but when I put several templates together one of my chart slides bombs. After a lot of investigating I discover my chart shape on the template has changed from a msoPlaceholder (#14) to a msoEmbeddedOLEObject (#7). Even more interesting, I discover that if I paste into the deck a new copy of the template slide it holds onto its msoPlacehoder shape. However, if I delete the slide above it (the slide with the chart that has somehow transmuted to a msoEmbeddedOLEObject) as the new template moves up into the position held by the deleted slide, its chart shape changes to an msoEmbeddedOLEObject.

    Can anyone help me understand why these shapes are transmuting as I insert/paste slides into the deck and how to keep it from happening?

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    You would need to give a lot more info. But some general things:

    If you are deleting slides in a loop ALWAYS work backwards:

    eg

    [VBA]For i = ActivePresentation.Slides.Count To 1 Step -1
    ' If whatever then ActivePresentation.Slides(i).Delete
    Next[/VBA]

    NOT

    [VBA]For i = 1 To ActivePresentation.Slides.Count
    ' If whatever then ActivePresentation.Slides(i).Delete
    Next[/VBA]

    You will get a different result for a type 7 shape if it is IN a placeholder.

    Try a Check for .PlaceHolderFormat.ContainedType

    [VBA]If oshp.Type = msoPlaceholder Then _
    MsgBox oshp.PlaceholderFormat.ContainedType[/VBA]
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  3. #3
    VBAX Regular
    Joined
    Feb 2012
    Posts
    41
    Location
    o.k., all useful. I will experiment a bit more to try and identify the exact circumstances under which the shape changes. I got tired after my long afternoon of figuring out what was happening. The most interesting thing to me was that the placeholder shape on the slide seemed to change to a OLE shape without running any VBA code. I was simply "cut-and-pasting" slides, watching the shape change shape, not running code. Not sure I made that clear in my initial post.

Posting Permissions

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