tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,926
- Office Version
- 365
- 2019
- Platform
- Windows
I am trying to copy a picture in Excel and paste it into a placeholder in a slide in Powerpoint.
but it fails on the last line, possibly because it's expecting text to be pasted, instead of a picture.
How can I amend my code to make it work?
Thanks
Code:
Dim ppApp As PowerPoint.Application
Set ppApp = New PowerPoint.Application
Sheet1.Cells(1, 1).Select
Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture
ppApp.Presentations(1).Slides(2).Shapes.Range(Array("Placeholder 1")).TextFrame.TextRange.PasteSpecial ppPasteBitmap
but it fails on the last line, possibly because it's expecting text to be pasted, instead of a picture.
How can I amend my code to make it work?
Thanks