Hi Everyone and @S Oberlander,
I tried to run the VBA code shared by @S Oberlander and received Run-time error '5'. Can anyone or @S Oberlander shed some light as to how to resolve the run-time error? any Excel setting that I need to update?
Here is the link to the original post by @S Oberlander .
Here is the VBA code that @S Oberlander shared in the post
I tried to run the VBA code shared by @S Oberlander and received Run-time error '5'. Can anyone or @S Oberlander shed some light as to how to resolve the run-time error? any Excel setting that I need to update?
Here is the link to the original post by @S Oberlander .
Here is the VBA code that @S Oberlander shared in the post
VBA Code:
Sub Extract_Data_from_PDF()
Dim App_Path As String
Dim Pdf_path As Variant
Dim shell_path As String
Dim i As Variant
Dim lastrow As Long
App_Path = "C:\Program Files (x86)\Adobe\Acrobat 9.0\Acrobat\Acrobat.exe"
Pdf_path = Application.GetOpenFilename("Pdf Files (*.pdf), *.pdf", , "Select Statements", , True)
For i = LBound(Pdf_path) To UBound(Pdf_path)
shell_path = App_Path & " """ & Pdf_path(i) & """"
Call Shell(pathname:=shell_path, windowstyle:=vbNormalFocus)
Application.Wait Now + TimeValue("0:00:03")
SendKeys "%vpc"
SendKeys "^a"
SendKeys "^c"
With ActiveSheet
lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row
End With
Range("a" & lastrow + 1).Select
ActiveSheet.PasteSpecial Format:="Text"
Next i
End Sub