I am trying to open a Powerpoint template from Excel using late binding. The following code works, however I would like to minimize or hide the Powerpoint application while the presentation is being populated with Excel data.
Have tried removing Line 7, but thencode fails at line 8.
Any help much appreciated.
Code:
Line 1: Dim ppApp As Object
Line 2: Dim ppPres As Object
Line 3: Dim ppSlide As Object
Line 4: Dim ppShape As Object
Line 5: Dim ppSlideNum As Integer
Line 6: Set ppApp = CreateObject("Powerpoint.Application")
Line 7: ppApp.Visible = True
Line 8: Set ppPres = ppApp.presentations.Open(Environ("userprofile") & "\ROI Advantage\Presentation Template.pot")
Line10: Set ppSlide = ppPres.Slides
'-----------------------------------------------------------------------------
'This selects slide 1 and copies the 'subject' and 'customer' data to the slide
'-----------------------------------------------------------------------------
Line 11: ppSlideNum = 1
Line 12: ppSlide(ppSlideNum).Select
Line 13: Set ppShape = ppPres.Slides(ppSlideNum).Shapes("txtSubject")
Line 14: ppShape.TextFrame.TextRange.Characters(Start:=1, Length:=0).Select
Line15: ppShape.TextFrame.TextRange.Text = ""
Line 16: ppShape.TextFrame.TextRange.Characters(Start:=1, Length:=0).Text = Sheet1.Range("Subject").Text
Bookmarks