Excel to PowerPoint

TorontoNewf

New Member
Joined
Nov 14, 2016
Messages
20
Greetings,

I am trying to export each picture on the activesheet to PowerPoint.

They are placed on every other row and every other column
i.e. B2, B4, B6, C2, C4, C6

Above those cells is the PPT layout type
i.e. ppLayoutChart, ppLayoutBlank, etc.

I want to export the picture and the related layout to PPT.

The related code is as follows:

Code:
For Each eSlide In ActiveSheet.Shapes
    Set PowerPointApp = GetObject(class:="PowerPoint.Application")
    eLayout = eSlide.TopLeftCell.Offset(-1, 0).Value
    NextSlide = myPresentation.Slides.Count + 1
    Set mySlide = myPresentation.Slides.Add(NextSlide, eLayout)     '''Error line
    myPresentation.Slides(NextSlide).Select
    eSlide.Copy
    mySlide.Shapes.PasteSpecial DataType:=2
Next eSlide                                                               '
I do not understand why the code bombs at 'Set mySlide ..." line
- am I not allowed to define the 'eLayout' variable in Excel and just simply pick it up?

Any suggestions / alternatives?
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Forum statistics

Threads
1,215,440
Messages
6,124,882
Members
449,193
Latest member
PurplePlop

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