gpt4 book ai didi

excel - Acrobat Reader 2017 引用 : MISSING: Adobe Acrobat XX. X 类型库

转载 作者:行者123 更新时间:2023-12-02 21:17:05 24 4
gpt4 key购买 nike

我可以在安装了 Acrobat Reader 2017 以及 Adob​​e Acrobat XI Pro 和 Distiller XI 的情况下运行以下代码。

我有另一台没有 XI Pro 或 Distiller 的计算机。

当我打开 Excel 工作表时出现第一个问题

Compile Error in hidden module: xxxxx

第二个问题在我的引用文献中

MISSING: Adobe Acrobat 10.0 Type Library

我取消选中它并再次运行,然后我在 Set acroDoc = New AcroPDDoc

上收到错误

我注意到我的工作 Excel 中有“ACROBAT”功能区,但在非工作 Excel 中却没有。

    Dim acroExchangeApp As Object
Set app = CreateObject("Acroexch.app")

Dim filePaths As Collection 'Paths for PDFS to append
Set filePaths = New Collection
Dim fileRows As Collection 'Row numbers PDFs to append
Set fileRows = New Collection
Dim sourceDoc As Object
Dim primaryDoc As Object ' PrimaryDoc is what we append too
Dim insertPoint As Long ' PDFs will be appended after this page in the primary Doc
Dim startPage As Long ' First desired page of appended PDF
Dim endPage As Long ' Last desired page of appended PDF
Dim colIndex As Long '
Dim numPages As Long
Dim acroDoc As Object
Set acroDoc = New AcroPDDoc


Set primaryDoc = CreateObject("AcroExch.PDDoc")
OK = primaryDoc.Open(filePaths(1))
Debug.Print "PRIMARY DOC OPENED & PDDOC SET: " & OK

For colIndex = 2 To filePaths.count
query_start_time = time()
start_memory = GetWorkingMemoryUsage

numPages = primaryDoc.GetNumPages() - 1

Set sourceDoc = CreateObject("AcroExch.PDDoc")
OK = sourceDoc.Open(filePaths(colIndex))
Debug.Print "(" & colIndex & ") SOURCE DOC OPENED & PDDOC SET: " & OK


numberOfPagesToInsert = sourceDoc.GetNumPages

'inserts pages
acroDoc.Open source_file_name

insertPoint = acroDoc.GetNumPages - 1


If endPage > 1 Then
OK = primaryDoc.InsertPages(insertPoint, sourceDoc, startPage, endPage - startPage, False)
Debug.Print "(" & colIndex & ") " & endPage - startPage & " PAGES INSERTED SUCCESSFULLY: " & OK
Else
OK = primaryDoc.InsertPages(insertPoint, sourceDoc, startPage, endPage - startPage + 1, False)
Debug.Print "(" & colIndex & ") " & endPage - startPage + 1 & " PAGES INSERTED SUCCESSFULLY: " & OK
End If


Set sourceDoc = Nothing

Next colIndex

OK = primaryDoc.Save(PDSaveFull, filePaths(1))
Debug.Print "PRIMARYDOC SAVED PROPERLY: " & OK

Set primaryDoc = Nothing
app.Exit
Set app = Nothing

最新更改:

首先我得到

Compile error, Cant find project or library

enter image description here

然后我取消选中“MISSING: Adob​​e Acrobat 10.0 Type Library”,这会解决此错误,

enter image description here

在我进行此更改后,现在出现以下错误:

将 acroDoc = New AcroPDDoc 设置为 设置 acroDoc = CreateObject("AcroExch.PDDoc")

现在在新行上出现错误,如下所示,

enter image description here

enter image description here

最佳答案

您目前正在混合后期绑定(bind)和早期绑定(bind)。为了使代码在计算机之间可移植,请始终使用后期绑定(bind)。这允许计算机在运行时查找库,而不是在运行代码之前在每台 PC 上手动硬链接(hard link)到文件。

更改此:

Set acroDoc = New AcroPDDoc

对此:

Set acroDoc = CreateObject("AcroExch.PDDoc")

阅读此内容: http://www.needforexcel.com/single-post/2015/10/09/Difference-Between-Early-Binding-Late-Binding

关于excel - Acrobat Reader 2017 引用 : MISSING: Adobe Acrobat XX. X 类型库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53328564/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com