PDA

View Full Version : Put Excel image to PowerPoint in specific location?



Dimitris254
05-31-2016, 03:19 PM
Hi all,

i have an image in an Excel worksheet, which i want -using a VBA sub- to copy in a specific location in a PowerPoint slide. Do i use the in-built PP ruler to define coordinates and how?

apparently i'm just starting to mess up with Excel-to-PP vba :o:

thanks in advance!

snb
06-01-2016, 12:34 AM
Please post sample files (Excel & Powerpoint).

If Excel file is open & powerpoint file is open:


Sub M_snb()
Sheet1.Shapes(1).CopyPicture
with GetObject(, "powerpoint.application").activepresentation.slides(1)
.Shapes.Paste
.Shapes(1).Top = 240
.shapes(1).Left = 160
End With
End Sub

Dimitris254
06-01-2016, 02:17 AM
Sure! I'm attaching the samples.

Place the pp_sample.pptx on the desktop and run the charts_to_PP sub.
The sub creates two charts within Sheet1, side-by-side, then opens the PP presentation.

i'm going to have more than 1 slides, and for test reasons, i'd like to copy the same charts in e.g. 3 slides. But that's the next step, first i need to get them in the slide as image (not linked-excel chart) in a certain location within a 16:9 slide.