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:
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?
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 '
- am I not allowed to define the 'eLayout' variable in Excel and just simply pick it up?
Any suggestions / alternatives?