Exporting Range of Data to PowerPoint

vmoore845

New Member
Joined
Oct 5, 2020
Messages
14
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
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

Trevor G

Well-known Member
Joined
Jul 17, 2008
Messages
6,708
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
14
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,708
Office Version
  1. 2016
Platform
  1. Windows
Happy to help and pleased to read you have resolved your code.
 

Forum statistics

Threads
1,148,269
Messages
5,745,778
Members
423,971
Latest member
Jogesh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top