Hi,
I want to copy chart from excel to powerpoint and paste as image:
I want to copy chart from excel to powerpoint and paste as image:
Code:
Dim wb As Workbook
Dim ws2 As Worksheet
Set wb = ActiveWorkbook
Set ws2 = wb.Worksheets("C2")
Dim newPowerPoint As PowerPoint.Application
Dim activeSlide As PowerPoint.Slide
Set newPowerPoint = New PowerPoint.Application
newPowerPoint.Presentations.Add
newPowerPoint.ActivePresentation.Slides.Add newPowerPoint.ActivePresentation.Slides.Count + 1, ppLayoutBlank
newPowerPoint.ActiveWindow.View.GotoSlide newPowerPoint.ActivePresentation.Slides.Count
Set activeSlide = newPowerPoint.ActivePresentation.Slides(newPowerPoint.ActivePresentation.Slides.Count)
'********************************************* C2
ws2.ChartObjects("Chart 1").Select
ActiveChart.ChartArea.Copy
activeSlide.Shapes.PasteSpecial(DataType:=ppPasteMetafilePicture).Select
[code]
I got error: run-time error '424':
object required
what I have wrong??