Consulting

Results 1 to 5 of 5

Thread: chart/ paste special

  1. #1
    VBAX Regular
    Joined
    Apr 2018
    Posts
    25
    Location

    chart/ paste special

    pastespecial.jpg
    I would like to paste a NOT linked chart from excel to a power point slide.
    I am not sure how the pastespecial option is called in english (probably something like "keep source formatting and embed the worksheet")

    I use
    (...).chartObject.chart.ChartArea.copy
    (...).slide.Shapes.PasteSpecial(ppPasteShape, link:=msoFalse)
    but the ppPasteDataType enum members do not correspond with what i see in the UI and the "link" param doesn't seem to do anything - the chart is linked regardless of its value.


    Any advice?

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    You probably need to PasteSpecial with DataType:=ppPasteOLEObject ,Link:=False

    ppPasteOLEObject is type 10 if you have not set a ref to PPT
    Last edited by John Wilson; 04-04-2018 at 03:41 AM.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  3. #3
    VBAX Regular
    Joined
    Apr 2018
    Posts
    25
    Location
    thanks a lot, it works.
    No idea how i missed that

  4. #4
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    You're welcome
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  5. #5
    VBAX Regular
    Joined
    Apr 2018
    Posts
    25
    Location
    Hm, I was too quick to rejoice. After pasting the chart with params as above, it seems to be corrupted (some odd things happen with its size and formatting when you click it)
    I ended up pasting it as a picture (as I do not want the fonts to get warped when you resize the shape, i do the following:


                Call .slide.Shapes.PasteSpecial(ppPasteEnhancedMetafile)
                Set myShape = .slide.Shapes(.slide.Shapes.count)
                Call myShape.Ungroup
    Last edited by mg25683; 04-04-2018 at 08:28 AM.

Tags for this Thread

Posting Permissions

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