简体   繁体   English

VBA:Acrobat运行时错误429; ActiveX组件无法创建对象

[英]VBA: Acrobat Run time error 429; ActiveX component can't create object

I have the following codes to read in contents from a PDF file in Excel VBA: 我有以下代码从Excel VBA中的PDF文件中读取内容:

'Note: A Reference to the Adobe Library must be set in Tools|References!
Dim AcroApp As CAcroApp, AcroAVDoc As CAcroAVDoc, AcroPDDoc As CAcroPDDoc
Dim AcroHiliteList As CAcroHiliteList, AcroTextSelect As CAcroPDTextSelect
Dim PageNumber, PageContent, Content, i, j
Set AcroApp = CreateObject("AcroExch.App")
Set AcroAVDoc = CreateObject("AcroExch.AVDoc")
If AcroAVDoc.Open(strFileName, vbNull) <> True Then Exit Function
' The following While-Wend loop shouldn't be necessary but timing issues may occur.
While AcroAVDoc Is Nothing
  Set AcroAVDoc = AcroApp.GetActiveDoc
Wend
Set AcroPDDoc = AcroAVDoc.GetPDDoc
For i = 0 To AcroPDDoc.GetNumPages - 1
  Set PageNumber = AcroPDDoc.AcquirePage(i)
  Set PageContent = CreateObject("AcroExch.HiliteList")
  If PageContent.Add(0, 9000) <> True Then Exit Function
  Set AcroTextSelect = PageNumber.CreatePageHilite(PageContent)
  ' The next line is needed to avoid errors with protected PDFs that can't be read
  On Error Resume Next
  For j = 0 To AcroTextSelect.GetNumText - 1
    Content = Content & AcroTextSelect.GetText(j)
  Next j
Next i
ReadAcrobatDocument = Content
AcroAVDoc.Close True
AcroApp.Exit
Set AcroAVDoc = Nothing: Set AcroApp = Nothing

End Function

Sub demo()

    Dim str As String
    str = ReadAcrobatDocument("C:\Desktop\asdf.pdf")

End Sub

However, I am getting the runtime 429 error at 但是,我得到运行时429错误

Set AcroApp = CreateObject("AcroExch.App")

What is wrong? 怎么了? I have Adobe Reader X and the references I've checked are: 我有Adobe Reader X,我检查的参考文献是:

Acrobat Access 3.0 Type Library AcroBrokerLib AcroIEHelper 1.0 Type Library AcroIEHelperShim 1.0 Type Library Adobe Acrobat Browser Control Type Library 1.0 Adobe Acrobat 10.0 Type Library Adobe Reader File Preview Type Library Acrobat Access 3.0类型库AcroBrokerLib AcroIEHelper 1.0类型库AcroIEHelperShim 1.0类型库Adobe Acrobat浏览器控件类型库1.0 Adob​​e Acrobat 10.0类型库Adobe Reader文件预览类型库

From the very first result in Google for the search query: 从Google搜索查询的第一个结果:

createobject acroexch.app error 429 createobject acroexch.app错误429

You cannot do this with Adobe Reader, you need Adobe Acrobat: 你不能用Adobe Reader做到这一点,你需要Adobe Acrobat:

This OLE interface is available with Adobe Acrobat, not Adobe Reader. 此OLE接口可用于Adobe Acrobat,而不是Adobe Reader。

https://forums.adobe.com/thread/657262 https://forums.adobe.com/thread/657262

暂无
暂无

声明:本站的技术帖子网页,遵循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 Excel VBA 编写内嵌 VBScript - 运行时错误“429”:ActiveX 组件无法创建对象 - Excel VBA Writing in-line VBScript - Run-time error '429': ActiveX component can't create object 创建Outlook对象会生成-运行时错误&#39;429&#39;: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组件无法创建对象 - run-time error '429' activex component can't create object 使用任务计划程序在 Excel 中运行 selenium v​​ba 宏时,如何修复“运行时错误 429:ActiveX 组件无法创建对象”错误? - How to fix "Run time error 429: ActiveX Component Can't Create Object" Error when using Task Scheduler to run a selenium vba macro in Excel? ActiveX 组件无法创建 object - 429 - ActiveX component can't create object - 429 脚本在调试模式下工作,但在正常运行下不工作-错误代码:429(ActiveX组件无法创建对象) - Script working in Debug Mode but not in Normal Run - Error Code: 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组件无法创建对象” - Error 429 “Activex component can't create object” when copying Cells to new worksheet Column
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM