简体   繁体   English

VBA错误429“ ActiveX无法创建应用程序对象”

[英]VBA Error 429 'ActiveX can't create application object'

Hi Guyz I'm writing these lines of code with powerpoint but getting error 429 嗨,Guyz,我正在使用Powerpoint编写这些代码行,但出现错误429

错误

pls help. 请帮助。

Option Explicit

Sub ListSlideInformationInExcel()
Dim i, j As Integer

Cells(1, 1).Value = "slide number"
Cells(1, 2).Value = "Name"
Cells(1, 3).Value = "No. of shapes"

Dim appPower As Object
Set appPower = CreateObject("Powerpoint.Application")
Dim pPres As PowerPoint.Presentation

appPower.Visible = True

appPower.Presentations.Open "C:\Users\SUMIT\Downloads\Slide Show Demo.ppt"

For i = 1 To pPres.Slides.Count
    j = 2
    Range("A" & j).Value = ActiveWindow.Selection.SlideRange.SlideIndex
    Range("B" & j).Value = ActivePresentation.Slides(i).Name
    Range("C" & j).Value = ActivePresentation.Slides(i).Shapes.Count
    j = j + 1
Next
End Sub

This may not fully solve your problem but assuming power point is installed you should be able to use late bound references all the way through as follows. 这可能无法完全解决您的问题,但假设安装了Power Point,则您应该能够始终使用后期绑定引用,如下所示。

Option Explicit
Sub ListSlideInformationInExcel()
    Dim i As Long, j As Long
    With ActiveSheet
        .Cells(1, 1).Value = "slide number"
        .Cells(1, 2).Value = "Name"
        .Cells(1, 3).Value = "No. of shapes"

        Dim appPower As Object, pPres As Object
        Set appPower = CreateObject("Powerpoint.Application")
        appPower.Visible = True    
        Set pPres = appPower.Presentations.Open("C:\Users\SUMIT\Downloads\Slide Show Demo.ppt")
        'Other stuff
    End With  
End Sub

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 Excel VBA 创建 Word 应用程序:运行时错误“429”:ActiveX 组件无法创建对象 - Creating Word Application using Excel VBA: Run-time error '429': ActiveX component can't create object 如何修复VBA中的“执行错误429:ActiveX无法创建对象”错误 - How to fix “Execution Error 429 : ActiveX can't create object” error in VBA 运行时错误“429”:ActiveX 组件无法在 VBA/VBS/WSH 中创建对象 - Run-time error '429': ActiveX component can't create object in VBA/VBS/WSH VBA:Acrobat运行时错误429; ActiveX组件无法创建对象 - VBA: Acrobat Run time error 429; ActiveX component can't create object ActiveX 组件无法创建 object - 429 - ActiveX component can't create object - 429 Excel VBA 编写内嵌 VBScript - 运行时错误“429”:ActiveX 组件无法创建对象 - Excel VBA Writing in-line VBScript - Run-time error '429': ActiveX component can't create object 运行时错误429,ActiveX组件无法创建对象,自动化MS Word应用程序,CreateObject(“Word.Application”) - Run-time error 429, ActiveX component can't create object, automate MS Word application, CreateObject(“Word.Application”) 创建Outlook对象会生成-运行时错误'429':ActiveX组件无法创建对象 - Creating Outlook object generates - Run-time error '429': ActiveX component can't create object 从 Excel 发送邮件 - 运行时错误“429”:ActiveX 组件无法创建对象 - Sending mails from Excel - Run-time error '429': ActiveX component can't create object 将单元格复制到新工作表列时出现错误429“Activex组件无法创建对象” - Error 429 “Activex component can't create object” when copying Cells to new worksheet Column
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM