Hi I am trying to write a macro that pastes charts as pictures into an existing powerpoint presentation.
I succeeded in making it paste but I also want to change the size of picture after that. There are other objects on the same slide of powerpoint and I wonder if there is a possibility to get the name of the last created shape and then apply the size changes.
Here is the peace of what I have so far:
Set xlWrkBook = xlApp.Workbooks.Open("....xls")
ppApp.Presentations.Open (".....ppt")
xlWrkBook.Sheets("SheetName").ChartArea.Copy
ppApp.ActivePresentation.Slides(slideNumber).Shapes.PasteSpecial DataType:=ppPasteMetafilePicture, Link:=False, DisplayAsIcon:=False
I would really be greatful for all kind of help.
I succeeded in making it paste but I also want to change the size of picture after that. There are other objects on the same slide of powerpoint and I wonder if there is a possibility to get the name of the last created shape and then apply the size changes.
Here is the peace of what I have so far:
Set xlWrkBook = xlApp.Workbooks.Open("....xls")
ppApp.Presentations.Open (".....ppt")
xlWrkBook.Sheets("SheetName").ChartArea.Copy
ppApp.ActivePresentation.Slides(slideNumber).Shapes.PasteSpecial DataType:=ppPasteMetafilePicture, Link:=False, DisplayAsIcon:=False
I would really be greatful for all kind of help.