2
我想通过Excel VBA打开Powerpoint端。但我得到以下运行时错误无法使用VBA打开Powerpoint
运行时错误-2147467259(80004005) 方法对象的“开放”“演示失败”
这是代码我试图
Sub createPPT(data As Workbook, ByVal pptpath As String)
Dim Sh As Shape
Dim PP As Object
Dim PPpres As Object
'Create a PP application and make it visible
Set PP = New PowerPoint.Application
PP.Visible = msoCTrue
Set PPpres = PP.Presentations.Open(pptpath)
Set Sh = data.Worksheets("Overall_Role").Shapes("Chart 3")
Sh.Copy
PPpres.Slides(6).Shapes.Paste
Set Sh = Nothing
Set PP = Nothing
Set PPpres = Nothing
End Sub
它显示在下面的代码 集PPpres误差= PP.Presentations.Open(pptpath)
预先感谢
你已经取得了一定的,在pptpath值格式正确,在那里你说该文件的我会假设的。但是,文件密码是否受到保护,您确定它没有损坏?你可以双击文件打开在PPT W/O任何错误? –
它为你工作。 – 0m3r