Hello
I am using Excel and PowerPoint 2003. I searched the threads and came up with the following code from lambuhere1:
With the above, the images are pasting to the bottom right of the slide (not on the slide) so I have to move them up AND the colours are not as used in Excel. How can this be fixed? Thanks.
I am using Excel and PowerPoint 2003. I searched the threads and came up with the following code from lambuhere1:
Code:
Sub CopyCharts()
Dim oppt As New PowerPoint.Application
Dim pptpres As Presentation
Dim pptslide As Slide
Dim ch As Chart
Dim wkb As Workbook
'build a temporary workbook
this_path = ActiveWorkbook.Path
strtempwkb = this_path + "\" + "tempwkb.xls"
'create new presentation
oppt.Visible = msoTrue
Set pptpres = oppt.Presentations.Add
With pptpres.Slides
lheight = pptpres.PageSetup.SlideHeight
lwidth = pptpres.PageSetup.SlideWidth
'place each chart in slide
For Each ch In ActiveWorkbook.Charts
ch.Copy
Set wkb = ActiveWorkbook
wkb.SaveAs strtempwkb
Set pptslide = .Add(.Count + 1, ppLayoutBlank)
pptslide.Shapes.AddOLEObject Left:=(lwidth), Top:=(lheight), Width:=(lwidth), Height:=(lheight), Filename:=strtempwkb, link:=msoFalse
'close temp workbook and delete it
wkb.Close savechanges:=msoFalse
Kill strtempwkb
Next ch
End With
End Sub
With the above, the images are pasting to the bottom right of the slide (not on the slide) so I have to move them up AND the colours are not as used in Excel. How can this be fixed? Thanks.