excel - VBA从excel粘贴到Powerpoint
问题描述
Sub jede_Grafik_nach_PowerPoint()
'Extras - Verweise: Microsoft PowerPoint x.x Object Library
Dim Grafik As Shape
Dim PP As Object
Set PP = CreateObject("Powerpoint.Application")
Dim PP_Datei As PowerPoint.Presentation
Dim PP_Folie As PowerPoint.Slide
Dim ws As Worksheet
Dim wb As Workbook
Set wb = ThisWorkbook
Set PP_Datei = PP.Presentations.Open("C:\Users\akaygun\Desktop\test.pptm")
PP.Visible = msoTrue
'Set PP_Datei = PP.ActivePresentation wenn akt. Präsi sein soll
For Each ws In wb.Sheets
If Left(ws.Name, 3) = "MLK" Then
'neue Folie einfügen
PP_Datei.Slides(3).Copy
PP_Datei.Slides.Paste
Set PP_Folie = PP_Datei.Slides(PP_Datei.Slides.Count)
'copypaste
ws.Shapes("Stunden").Copy
PP_Folie.Shapes.Paste
PP_Folie.Shapes("Stunden").Top = 315.1991
PP_Folie.Shapes("Stunden").Left = 22.17449
ws.Shapes("Tage").Copy
PP_Folie.Shapes.Paste
PP_Folie.Shapes("Tage").Top = 10.16945
PP_Folie.Shapes("Tage").Left = -2.806772
End If
Next ws
End Sub
亲爱的社区,我正在尝试通过 VBA 自动将图表从 excel 粘贴到 Powerpoint。运行此 Sub 时,它总是说:“远程服务器计算机不存在”'462' 我已经尝试设置一个新的演示文稿而不是一个对象,但它没有帮助。
解决方案
推荐阅读
- sql - 在 SQL 中,即使日期没有数据点,有没有办法显示所有日期?
- python - TensorFlow 在一个 GPU 上同时训练多个较小的批次
- ios - AVCapturePhotoOutput didFinishProcessingPhoto 没有被调用
- android - 更改 TextField 中光标的大小(Jetpack Compose)
- azure - 如何在通过 ARM 创建 Key Vault 时分配“Key Vault Secrets User”RBAC 角色
- python - Flask 博客文章正在删除最后一篇博客文章,而不是想要的
- c# - 如何在 C# TCP 中的客户端-服务器之间同时读写两种方式
- flutter - TextFormField 不再关注重绘
- github - gitlab管道在代码推送和合并请求时自动添加
- validation - API 测试:验证动态 Rest Response 的方法(底层数据库中的 JSON 属性/值经常变化)