open ppt from excel

jasman

Board Regular
Joined
Oct 30, 2010
Messages
141
Hi. I have an excel workseet with an image. I need excel to open a new powerpoint show and copy that image into it when i click a button?

any help thanks
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
You need to set the Reference to use your version of PowerPoint in the VBA screen of your excel spreadsheet. As your asking I hope you can get into the VBA screen (Use Alt + F11) then go to the Tools Menu and References then scroll down the list until you find Microsoft PowerPoint (XX) Object Library and tick the box, XX is the version number, then you could use somthing like this:

Go to the Insert Menu and select Module copy this code into it, and it will open powerpoint and add a presentation plus one slide. You will have to add the code to copy the object in Excel first then paste into your PowerPoint presentation.

Sub CopyToPowerPoint()
Dim pptApp As PowerPoint.Application
Dim pres1 As PowerPoint.Presentation
Dim Slide1 As PowerPoint.Slide
Set pptApp = CreateObject("PowerPoint.Application")
With pptApp
.Visible = True
Set pres1 = pptApp.Presentations.Add
End With
Set Slide1 = pres1.Slides.Add(1, ppLayoutText)
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,551
Messages
6,179,473
Members
452,915
Latest member
hannnahheileen

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