1

我正在将 pdf 导出到 excel,但有些我无法在我的 vba 代码中为 Acrobat.AcroPDDoc 创建对象

导入引用下面提到的库

我的vba代码在

Dim AC_PD As Acrobat.AcroPDDoc              'access pdf file
Dim AC_Hi As Acrobat.AcroHiliteList         'set selection word count
Dim AC_PG As Acrobat.AcroPDPage             'get the particular page
Dim AC_PGTxt As Acrobat.AcroPDTextSelect    'get the text of selection area

Dim WS_PDF As Worksheet
Dim RW_Ct As Long                           'row count
Dim Col_Num As Integer                      'column count
Dim Li_Row As Long                          'Maximum rows limit for one column
Dim Yes_Fir As Boolean                      'to identify beginning of page

Li_Row = Rows.Count


Set AC_PD = New Acrobat.AcroPDDoc
Set AC_Hi = New Acrobat.AcroHiliteList

在为 AC_PD 创建新对象时,它显示无法创建 ActivX 组件无法对象如何解决此问题。先感谢您

4

1 回答 1

2

要创建 Acro 对象,您必须使用 AcroExch。所以使用:设置 AC_PD = CreateObject("AcroExch.PDDoc")。你会在这个网站上找到很多很多的例子。如果您拥有完整的 Adob​​e Acrobat 版本(不是仅限 Reader),一切都会正常工作

于 2019-02-28T15:43:46.893 回答