Hi,
I'm absolutely lost with vba in Excel to generate a Powerpoint Presentation.
So far I easily managed to generate the presentation and fill "Text Placeholders" wiht Text, but I#M failing with Pictures. The main part of my code looks like this:
For x = 1 To NumberOfPages
Set currentSlide = myPPT.Slides(x)
With currentSlide
.Shapes(1).TextFrame.TextRange.Text = Cells(x + 1, 2).Text & ", " & Cells(x + 1, 3).Text
.Shapes(3).TextFrame.TextRange.Text = Cells(x + 1, 4).Text
.Shapes(4).TextFrame.TextRange.Text = Cells(x + 1, 10).Text
.Shapes(5).TextFrame.TextRange.Text = Cells(x + 1, 11).Text
'the image!!
.Shapes(2).AddPicture ........
End With
Next
the last Shape is a "Picture Placeholder" and I tryed to add a Picture manually by
.Shapes(2).AddPicture(FileName:="C:\Program Files\Microsoft Office\" _
& "Office\Bitmaps\Styles\stone.bmp", _
LinkToFile:=True, SaveWithDocument:=True)
I also tryed a Picture Object and searched for Propertys of the Placeholder to change the url or something like that.
The goal is to load a pictures into every Slide (therefore the Placeholder 2 in the template). The File names and extentions are stored in the Excel Sheet in Cells(x +1, 13)
Please help me with that, because I totaly get lost, writing PowerPoint vba in Excel Macros.
Thanks
|