(Solved) – Mac – Copy/paste charts from Excel to Powerpoint via VBA (Excel/PPT V.16.35)

(solved)-–-mac-–-copy/paste-charts-from-excel-to-powerpoint-via-vba-(excel/ppt-v16.35)

Hi I am trying to copy Charts from an Excel Sheet and paste them in an Powerpoint Slide.
I’ve tried two ways of implementing it in VBA.

1.Option:
failed – doesn’t support property or method > PasteSpecial.

For i = 1 To 10
    ppFile.Slides(i   1).Select

    Worksheets("Darstellung").ChartObjects(i).CopyPicture

    Set objShape = ppFile.Slides(i   1).Shapes.PasteSpecial(Datatype:=ppPasteDefault)'<<< problem in this line

With objShape
    .LockAspectRatio = msoFalse
    .ScaleWidth 1.5, msoTrue
    .ScaleHeight 1.9, msoFalse


    .Top = 100
    .Height = 350
    .Width = 700
    .Left = 150
End With

Set objShape = Nothing

Next

2.Option:
semi failed - works but needs 1 and half minute to paste one chart and throws exception: "excel is waiting for another application to complete an ole action" after every chart. Clicking ok lets the VBA run and paste the next chart.

For i = 1 To 10
    ppFile.Slides(i   1).Select

    Worksheets("Darstellung").ChartObjects(i).CopyPicture

    Set objShape = ppFile.Slides(i   1).Shapes.Paste '<<< problem in this line

With objShape
    .LockAspectRatio = msoFalse
    .ScaleWidth 1.5, msoTrue
    .ScaleHeight 1.9, msoFalse


    .Top = 100
    .Height = 350
    .Width = 700
    .Left = 150
End With

Set objShape = Nothing

Next

Is there any way to implement it on Mac, so it runs properly and efficient?

Leave a Reply

Your email address will not be published. Required fields are marked *