excel - Mac - 通过 VBA 将图表从 Excel 复制/粘贴到 Powerpoint (Excel/PPT V.16.35)
问题描述
您好我正在尝试从 Excel 工作表中复制图表并将它们粘贴到 Powerpoint 幻灯片中。我尝试了两种在 VBA 中实现它的方法。
1.Option: failed - 不支持属性或方法> PasteSpecial。
For i = 1 To 10
ppFile.Slides(i + 1).Select
Worksheets("Darstellung").ChartObjects(i).CopyPicture
Set objShape = ppFile.Slides(i + 1).Shapes.PasteSpecial(Datatype:=ppPasteDefault)'<<< problem in this line
With objShape
.LockAspectRatio = msoFalse
.ScaleWidth 1.5, msoTrue
.ScaleHeight 1.9, msoFalse
.Top = 100
.Height = 350
.Width = 700
.Left = 150
End With
Set objShape = Nothing
Next
2.选项:半失败 - 工作但需要 1 分半钟来粘贴一个图表并在每个图表之后抛出异常:“excel 正在等待另一个应用程序完成 ole 操作”。单击确定让 VBA 运行并粘贴下一个图表。
For i = 1 To 10
ppFile.Slides(i + 1).Select
Worksheets("Darstellung").ChartObjects(i).CopyPicture
Set objShape = ppFile.Slides(i + 1).Shapes.Paste '<<< problem in this line
With objShape
.LockAspectRatio = msoFalse
.ScaleWidth 1.5, msoTrue
.ScaleHeight 1.9, msoFalse
.Top = 100
.Height = 350
.Width = 700
.Left = 150
End With
Set objShape = Nothing
Next
有什么方法可以在 Mac 上实现它,让它运行正常且高效吗?
解决方案
推荐阅读
- amazon-web-services - AWS SNS 从 Ec2 独立 Java 应用程序推送到 android 手机
- python - gem5 "ImportError: No module named Six" 即使安装了模块六
- tcp - TCP 可靠服务
- c++ - C++:右值引用构造函数和复制省略
- ffmpeg - 使用FFmpeg重新编码时如何获得视频无损旋转?
- airflow - 为什么我的 Airflow DAG 没有运行完成?
- github - 谁可以转让回购所有权
- python - SQLITE3 python根据字符串日期yyyy/mm/dd hh:mm:ss删除行
- wordpress - 我想知道如何让这个 CSS 只在 Woocommerce 上的某些产品上工作?
- c++ - 如何在 C++ 中创建 if else 循环而不是多个嵌套?