'Trying to export range from excel into powerpoint
Can anyone tell me why this VBA code to export a range from excel into powerpoint crashes when it comes to "PPTSlide.Shapes.Paste"?
Sub ExportRange()
Application.ScreenUpdating = False
Dim PPTApp As PowerPoint.Application
Dim PPTPres As PowerPoint.Presentation
Dim PPTSlide As PowerPoint.Slide
Dim ExcRng As Range
Set PPTApp = New PowerPoint.Application
PPTApp.Visible = True
Set PPTPres = PPTApp.Presentations.Add
Set PPTSlide = PPTPres.Slides.Add(1, ppLayoutTitleOnly)
Set ExcRng = Range("A1:C6")
ExcRng.Copy
Application.Wait Now + #12:00:01 AM#
PPTSlide.Shapes.Paste
Application.ScreenUpdating = True
End Sub
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
