ACROEXCH

CSAPI1 04/06/2015 17:42:13
#447404
Estou tentando executar o programa com o código abaixo:

[ô]Sub MyPDFTOExcel()

Dim strFileName As String, intNOP As Integer, arrI As Variant
Dim intC As Integer, intR As Integer, intBeg As Integer, intEnd As Integer
Dim docpdf As Object
Dim appAA As Object
Set appAA = CreateObject([Ô]AcroExch.App[Ô])
Set docpdf = CreateObject([Ô]AcroExch.PDDoc[Ô])

[ô]Set PDF FileName
strFileName = [Ô]C:\PDFToExcel    est.pdf[Ô] [ô]Source file name

[ô]Read PDF File
docpdf.Open (strFileName)

[ô]Extract Number of Pages From PDF File
intNOP = docpdf.GetNumPages

[ô]Select First Data Cell
Range([Ô]A1[Ô]).Select

[ô]Open PDF File
ActiveWorkbook.FollowHyperlink strFileName, , True

[ô]Loop Through All PDF File Pages
For intC = 1 To intNOP
[ô]Go To Page Number
SendKeys ([Ô]+^n[Ô] & intC & [Ô]{ENTER}[Ô])

[ô]Select All Data In The PDF File[ô]s Active Page
SendKeys ([Ô]^a[Ô]), True

[ô]Right-Click Mouse
SendKeys ([Ô]+{F10}[Ô]), True

[ô]Copy Data As Table
SendKeys ([Ô]c[Ô]), True

[ô]Minimize Adobe Window
SendKeys ([Ô]%n[Ô]), True

[ô]Paste Data In This Workbook[ô]s Worksheet
ActiveSheet.Paste

[ô]Select Next Paste Cell
Range([Ô]A[Ô] & Range([Ô]A1[Ô]).SpecialCells(xlLastCell).Row + 2).Select

[ô]Maximize Adobe Window
SendKeys ([Ô]%x[Ô])
Next intC

[ô]Close Adobe File and Window
SendKeys ([Ô]^w[Ô]), True

[ô]Empty Object Variables
Set appAA = Nothing: Set docpdf = Nothing

[ô]Select First Cell
Application.Run [Ô]Book1!PDFTOEXCEL[Ô]
ChDir [Ô]C:\ExcelConverter    est.xls[Ô]
ActiveWorkbook.SaveAs FileName:=[Ô]C:\ExcelConverter\PDFTOEXCEL.xlsm[Ô], _
FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
ActiveWorkbook.Save
Application.WindowState = xlMinimized
ActiveWorkbook.Save
Range([Ô]A1[Ô]).Select
End Sub

Ao executar o seguinte erro aparece:

run-time error [ô]429[ô] activex component can[ô]t create object

Como posso resolver isso?

Grato
KERPLUNK 05/06/2015 00:33:17
#447418
Você nem sequer tirou os comentários de onde você copiou... Você chegou a depurar o código e ver em que linha isto acontece? Apesar que eu tenho quase certeza que é numa dessas:

Set appAA = CreateObject([Ô]AcroExch.App[Ô])
Set docpdf = CreateObject([Ô]AcroExch.PDDoc[Ô])
Tópico encerrado , respostas não são mais permitidas