Paste Excel data into Powepoint

tiredofit

Well-known Member
Joined
Apr 11, 2013
Messages
1,924
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
I am trying to control Powerpoint from Excel by following this video:


This is the code:


Rich (BB code):
Option Explicit


Sub Start()


    Dim ppApp As PowerPoint.Application
    Dim ppPres As PowerPoint.Presentation
    Dim ppSlide As PowerPoint.Slide
    
    Set ppApp = New PowerPoint.Application
    
    ppApp.Visible = msoTrue
    
    ppApp.Activate
    
    Set ppPres = ppApp.Presentations.Add
    
    Set ppSlide = ppPres.Slides.Add(1, ppLayoutTitle)
    
    ppSlide.Shapes(1).TextFrame.TextRange = "Work"
    ppSlide.Shapes(2).TextFrame.TextRange = "Some work"
    
    Set ppSlide = ppPres.Slides.Add(2, ppLayoutBlank)
    
    ppSlide.Select
    
    Range("A1").CurrentRegion.Copy
    
    ppSlide.Shapes.Paste
    
End Sub


It works in the video but fails for me on this line:


Rich (BB code):
ppSlide.Shapes.Paste


with the message:


Rich (BB code):
Run-timeerror '-2147188160 (80048240)':

Method 'Paste' of object 'Shapes' failed

What is wrong?

The only difference is I'm using Excel 2010, the video is Excel 2013.

Thanks
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
i would be looking to swap
ppSlide.Select

Range("A1").CurrentRegion.Copy
with each other, not sure if that is a cause
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,260
Members
452,627
Latest member
KitkatToby

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
Back
Top