Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Kunkulis
Creator
Creator

How to paste chart in particular PowerPoint shape

Hi,

How can I paste chart in particular shape in PPT slide?

This is part of code:

Set CurrChart = ActiveDocument.GetSheetObject("CH01")
CurrChart.Restore
CurrChart.Activate
APP.Sleep 360
ActiveDocument.GetSheetObject("CH01").CopyBitmapToClipboard

With PPSlide.Shapes(3).Paste 
.LockAspectRatio = false
.Left = 510
.Top = 130
.Width = 374
.Height = 165
End With

I want to paste chart in shape 3, but it is not working - script stops and macro edit module opens. 

How can I achieve this?

Thanks!

1 Reply
petter
Partner - Champion III
Partner - Champion III

If you take a closer look at the Microsoft PowerPoint Object Model you will find that there is no "Paste" method for a "Slide" object. 

So

        PPSlide.Shapes(3).Paste 

cannot work...

Furthermore the With statement should be used with an object and not on a method.

 

The Shapes object however has a Paste method so something like this might work:

Set pastedShape = PPSlide.Shapes.Paste
With pastedShape
  .LockAspectRatio = False
  .Left = 510
  .Top = 130
  .Width = 374
  .Height = 165
End With