Sub ExcelToNewPowerPoint()
Dim PPApp As Object
Dim PPPres As Object
Dim PPSlide Object
' Create instance of PowerPoint
Set PPApp = CreateObject("Powerpoint.Application")
' For automation to work, PowerPoint must be visible
' (alternatively, other extraordinary measures must be taken)
PPApp.Visible = True
' Create a presentation
Set PPPres = PPApp.Presentations.Add
' Some PowerPoint actions work best in normal slide view
PPApp.ActiveWindow.ViewType = ppViewSlide
' Add first slide to presentation
Set PPSlide = PPPres.Slides.Add(1, ppLayoutTitleOnly)
''---------------------
'' Do Some Stuff Here
''---------------------
' Save and close presentation
With PPPres
.SaveAs "C:My DocumentsMyPreso.ppt"
.Close
End With
' Quit PowerPoint
PPApp.Quit
' Clean up
Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing
End Sub
|