Range(strRange).Copy
Range("A1").Select
Debug.Print Err.Description
ActiveWorkbook.Range("Excel" & strRange).Select
ActiveSheet.ChartObjects(strRange).Activate
ActiveChart.ChartArea.Copy
Range("A1").Select
Function CopyRangeToPPT(oPPTApp As PowerPoint.Application, intSlideNum As Integer, intLeft As Integer, intWidth As Integer, intHeight As Integer, intTop As Integer, strRange As String) As String
Dim shShape As Object, strError As String
'delete shape if it exists on slide
On Error Resume Next
oPPTApp.ActivePresentation.Slides("Slide_" & strRange).Shapes("ExcelSlide_" & strRange).Delete
If Err.Number <> 0 Then CopyRangeToPPT = Err.Number & " " & Err.Description & ": " & strRange & vbCrLf
Err.Clear
' Select the range then copy it.
On Error GoTo 0
ActiveWorkbook.Range("Excel" & strRange).Select
ActiveSheet.ChartObjects(strRange).Activate
ActiveChart.ChartArea.Copy
Range("A1").Select
' ActiveSheet.ChartObjects("strRange").Activate
' ActiveChart.ChartArea.Copy
'
'
' ActiveSheet.ChartObjects("Slide1").Activate
' ActiveChart.ChartArea.Copy
'
' Range(strRange).Copy
' Range("A1").Select
' Debug.Print Err.Description
' Paste the range
Set shShape = oPPTApp.ActivePresentation.Slides(intSlideNum).Shapes.PasteSpecial(ppPasteEnhancedMetafile)
'' oPPTApp.Run ("ResizeShapeSize")
' Align the pasted range
With shShape
.LockAspectRatio = 0
.Left = intLeft
.Top = intTop
.Width = intWidth
.Height = intHeight
.Name = "ExcelSlide_" & strRange
End With
End Function
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.