Public
Sub
CopyChart(wSheet
As
String
, cChart
As
String
, iSlide
As
Integer
, xVal
As
Double
, yVal
As
Double
, xDif
As
Double
, yDif
As
Double
, shpNo
As
Integer
)
Dim
objPP
As
PowerPoint.Application
Dim
objPres
As
PowerPoint.Presentation
Set
objPP = GetObject(,
"Powerpoint.Application"
)
Set
objPres = objPP.ActivePresentation
Worksheets(wSheet).
Select
Worksheets(wSheet).Shapes(cChart).Chart.ChartArea.
Select
Call
Worksheets(wSheet).Shapes(cChart).Chart.ChartArea.Copy
Set
objShpRange = objPres.Slides(iSlide).Shapes.PasteSpecial(ppPastePNG)
Set
objShpRange = objPres.Slides(iSlide).Shapes(shpNo)
With
objShpRange
.Top = yVal
.Left = xVal
.Height = yDif
.Width = xDif
.Line.Visible = msoFalse
End
With
End
Sub