Exporting Range of Data to PowerPoint

vmoore845

New Member
Joined
Oct 5, 2020
Messages
9
Office Version
  1. 2010
Platform
  1. Windows
I have an Excel Workbook with Data in A1:D16 on each worksheet in the workbook, that I want to export to PowerPoint, the data is a mini financial statement (No charts, not table, just numbers). When I run the script I get a Run-time error '424': Object Required Can you tell me what is wrong?

1602095586843.png



Sub ExportRangeToPowerPoint()

'Declare PowerPoint Object Variables
Dim PPTApp As PowerPoint.Application
Dim PPTPres As PowerPoint.Presentation
Dim PPTSlide As PowerPoint.Slide

'Declare Excel Object Variable
Dim ExcRng As Range

'Create a new instance of PowerPoint
Set PPTApp = New PowerPoint.Application
PPTApp.Visible = True

'Create a new Presentation within the Application
Set PPTPres = PPTApp.Presentations.Add

'Create a new slide within the presentation
Set PPTSlide = PPTPres.Slides.Add(1, ppLayoutTitleOnly)

'Create a reference to the Excel Range we want to Export
Set ExcRng = Range("A1:D16")

'Copy the range
ExcRng.Copy

'Paste the range in the slide
PPPTSlide.Shapes.Paste




End Sub
 

Some videos you may like

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Trevor G

Well-known Member
Joined
Jul 17, 2008
Messages
6,675
Office Version
  1. 2016
Platform
  1. Windows
You have three P for your last PPPTSlide.Shapes.Paste change to two and it will work.
 

vmoore845

New Member
Joined
Oct 5, 2020
Messages
9
Office Version
  1. 2010
Platform
  1. Windows
Great, thank you. I guess I have been writing PPPL, Pay Check Protection Loans, so much it was automatic. Thank you very much.
 

Trevor G

Well-known Member
Joined
Jul 17, 2008
Messages
6,675
Office Version
  1. 2016
Platform
  1. Windows
Happy to help and pleased to read you have resolved your code.
 

Watch MrExcel Video

Forum statistics

Threads
1,112,772
Messages
5,542,445
Members
410,552
Latest member
Yogesh977
Top