我必须将大量Excel图表发布到特定的PowerPoint文档中,然后在Excel VBA中构建一个宏来为我完成 .
我知道如何设置我刚刚打开一个名为 MyPresentation
的变量的演示文稿 .
Dim myPresentation As PowerPoint.Presentation
Dim PowerPointApp As PowerPoint.Application
PowerPointApp.Presentations.Open Filename:="obscured filepath and name"`
显然有's some additional code, but I' m试图将我刚刚在第3行设置的Presentation设置为 MyPresentation
变量,所以我可以引用我刚打开的文档 .
2 回答
我最终找到了MVP Andy Pope的解决方案 .
一些相关的代码片段供未来用户使用 . (仅供我参考,当我遇到问题时,我的PPT已经可见)
查看Spreadsheet Guru从Excel VBA打开PPT的指南
然后:
首先,你必须为使用ppt文件铺平道路,我做了什么: