Hope someone can help me with VBA code. I use a VBA loop to insert Excel charts, text fields and tables into a Powerpoint template. However, since I cannot be sure that the user will have the Powerpoint object library installed, I cannot use Dim PPTApp as a syntax like Powerpoint.Application.
I use objects. It works great. Except for one part: closing Powerpoint.
the code:
Dim oPPTPres As Object ' Late binding: This is a PowerPoint.Presentation but we cannot assume that the Microsoft PowerPoint 11 library will be loaded in the workbook that this module has been copied to.
Dim oPPTShape As Object ' Late binding: This is a PowerPoint.Shapebut we cannot assume that the Microsoft PowerPoint 11 library will be loaded in the workbook that this module has been copied to.
PPTFile = Range("PPTFile").value ' Read PowerPoint template file name
Set oPPTPres = GetObject(PPTFile): oPPTPres.Application.Visible = msoTrue ' Switch to or open template file
. ,,.
strNewPresPath = Range("OutputFileName").value
oPPTPres.SaveAs strNewPresPath
' Range("PPTFile").value = strNewPresPath
ScreenUpdating = True
oPPTPres.Close 'Closes presentation but not Powerpoint
oPPTPres.Application.Quit 'No noticeable effect
, Powerpoint ( ). , , ( , ), , Powerpoint, .
?
!