Excel VBA resize picture in powerpoint

G

Guest

Hello !!
I'm doing a lot of presentations using my Excel workbook as base.
So, I've written a code to copy each of my sheets, convert them in pictures
and paste in Powerpoint.

I use the same 1st page in my presentations and the same conception model so
I work with the same powerpoint file as base for all presentations created
from Excel.

My QUESTION :
---> How can I manage to resize every picture to fit Slides Dimension ?

Thank you very much to help me !!!

Here is my VBA code :
---------------------------------------------
Sub copyinpowerpoint()
Dim pPoint As PowerPoint.Application
Dim dPoint As PowerPoint.Presentation
Set pPoint = New PowerPoint.Application
pPoint.Visible = True
Set dPoint = pPoint.Presentations.Open("D:\my.ppt")
Set Diapo2 = .Slides.Add(Index:=2, Layout:=ppLayoutBlank)
Sheets("sheet1").UsedRange.CopyPicture Appearance:=xlScreen, Format:=xlPicture
Diapo2.Shapes.Paste
 
S

sharad.net

Hello !!
I'm doing a lot of presentations using myExcelworkbook as base.
So, I've written a code to copy each of my sheets, convert them in pictures
and paste in Powerpoint.

I use the same 1st page in my presentations and the same conception modelso
I work with the same powerpoint file as base for all presentations created
fromExcel.

My QUESTION :
---> How can I manage to resize every picture to fit Slides Dimension ?

Thank you very much to help me !!!

Here is my VBA code :
---------------------------------------------
Sub copyinpowerpoint()
Dim pPoint As PowerPoint.Application
Dim dPoint As PowerPoint.Presentation
Set pPoint = New PowerPoint.Application
pPoint.Visible = True
Set dPoint = pPoint.Presentations.Open("D:\my.ppt")
Set Diapo2 = .Slides.Add(Index:=2, Layout:=ppLayoutBlank)
Sheets("sheet1").UsedRange.CopyPicture Appearance:=xlScreen, Format:=xlPicture
Diapo2.Shapes.Paste

Hi,

I guess you can resize the picture by shaperange.width and length
procedure, and specifying your size.

Sharad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top