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 'ppApp.Visible=true' but then code fails at next line.
Any help much appreciated.
Dim ppApp As Object
Dim ppPres As Object
Dim ppSlide As Object
Dim ppShape As Object
Dim ppSlideNum As Integer
Set ppApp = CreateObject("Powerpoint.Application")
ppApp.Visible = True
Set ppPres = ppApp.presentations.Open(Environ("userprofile") & "\ROI Advantage\Presentation Template.pot")
Set ppSlide = ppPres.Slides
'-----------------------------------------------------------------------------
'This selects slide 1 and copies the 'subject' and 'customer' data to the slide
'-----------------------------------------------------------------------------
ppSlideNum = 1
ppSlide(ppSlideNum).Select
Set ppShape = ppPres.Slides(ppSlideNum).Shapes("txtSubject")
ppShape.TextFrame.TextRange.Characters(Start:=1, Length:=0).Select
ppShape.TextFrame.TextRange.Text = ""
ppShape.TextFrame.TextRange.Characters(Start:=1, Length:=0).Text = Sheet1.Range("Subject").Text
Bookmarks