希望有人可以帮我一些VBA代码.我使用VBA循环将Excel图表,文本框和表格粘贴到Powerpoint模板中.但是,因为我无法确定用户是否安装了Powerpoint对象库,所以我不能将Dim PPTApp用作Powerpoint.Application类型语法.
我用对象.它很棒.除了一件:关闭Powerpoint.
码:
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 …Run Code Online (Sandbox Code Playgroud)