我正在尝试从excel表生成自动powerpoint幻灯片。特别是,我正在尝试添加与工作表位于同一文件夹中的图片。
我的代码基本上是
这是我的代码:
Option Explicit
Sub CreatePPT()
Dim PptApp As PowerPoint.Application
Dim PptDoc As PowerPoint.Presentation
Dim Image As String
Dim oShape As PowerPoint.Shape
Set PptApp = CreateObject("Powerpoint.Application")
PptApp.Visible = True
Set PptDoc = PptApp.Presentations.Add
PptDoc.Slides.Add 1, ppLayoutPictureWithCaption
Image = ThisWorkbook.Path & ":logo.jpg"
PptApp.Activate
'The following line doesn't work!!!
Set oShape = PptDoc.Slides(1).Shapes.AddPicture(Image, False, True, 0, 0, -1, -1)
End Sub
这看起来非常简单易行,但我无法弄清楚。
重要提示:我正在办公室为mac 2011
感谢您的帮助 干杯