简体   繁体   English

使用 VBA 将图表从 Excel 复制到 PowerPoint

[英]Copy charts from Excel to PowerPoint using VBA

I have a slide deck that changes it's name daily.我有一个幻灯片,每天都在改变它的名字。 The source data is in several statically named Excel 2013 worksheets.源数据位于几个静态命名的 Excel 2013 工作表中。 It would be neater to run a macro from the PPTM but all the examples I have found for copying charts is from the XLSM side.从 PPTM 运行宏会更简洁,但我发现的所有复制图表的示例都来自 XLSM。 Is there a PowerPoint 2013 equivalent of PowerPoint.Application ?是否有相当于PowerPoint.Application的 PowerPoint 2013 ? Dim sourceXL As excel.Application gives Run-time error '424': Oject required as Excel is not recognised whereas .Application is. Dim sourceXL As excel.Application给出运行时错误 '424': Oject required as Excel is not识别而 .Application 是。

Have you set a reference to Excel?您是否设置了对 Excel 的引用? In the VBE, go to the Tools menu > References, scroll down to Microsoft Excel, and check the box.在 VBE 中,转到工具菜单 > 引用,向下滚动到 Microsoft Excel,然后选中该框。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM