【问题标题】:Run-Time Error 430 for Power point application in VBAVBA 中的 Power Point 应用程序的运行时错误 430
【发布时间】:2017-08-14 21:33:18
【问题描述】:

我想通过 VBA 代码创建 powerpoint 演示文稿,并且我还在工具中选择了库(早期绑定)参考。但我无法通过 VBA 创建 Powerpoint 应用程序。我写了下面的代码,我收到错误 “类不支持自动化或不支持预期的接口”。请您帮忙解决问题。

Sub CreatePPT()

Dim MYPPT As PowerPoint.Application
Set MYPPT = New PowerPoint.Application

With MYPPT

    .Visible = msoTrue
    .Activate

End With

End Sub

【问题讨论】:

  • 哪里改,我两个地方都改了。但还是报错

标签: vba excel


【解决方案1】:

您应该添加一个演示文稿:

Sub CreatePPT()

Dim MYPPT As PowerPoint.Application
Set MYPPT = New PowerPoint.Application

Dim PPTPresent as PowerPoint.Presentation

With MYPPT

    .Visible = msoTrue
     set PPTPresent = .Presentations.add
End With

End Sub

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-15
    • 1970-01-01
    • 2022-12-23
    • 1970-01-01
    相关资源
    最近更新 更多