One way:
' Paste chart
PPSlide.Shapes.Paste.Select
' Align pasted chart
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles, True
Another way:
' Paste chart
PPSlide.Shapes.Paste.Select
Set pptChartShape = opptapp.ActiveWindow.Selection.ShapeRange(1)
With pptChartShape
.ScaleWidth myScale, msoTrue, msoScaleFromMiddle
.ScaleHeight myScale, msoTrue, msoScaleFromMiddle
End With
The hard part is knowing how to refer to the pasted chart picture. Once you know that, you can
substitute positioning and resizing (.Left, .Top, .Width, .Height) for the .Align and .Scale
properties in my examples.
- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
Iker wrote:
I have copied some parts of an excel table and paste them
in powerpoint as an image. This is the code:
******************
Range("C10").Select
Selection.CopyPicture Appearance:=xlScreen, _
Format:=xlPicture
PPSlide.Shapes.Paste
(where PPSlide is the selected slide in the Powerpoint
presentation)
*****************
Now, my question is:
How can I move the pasted object to the right position in
the Powerpoint Slide?
I am running the macro from Excel. Office200.
Thanks!