S Oberlander
Board Regular
- Joined
- Nov 25, 2020
- Messages
- 153
- Office Version
- 365
- Platform
- Windows
I got the below code from How to Extract Specific Data from PDF to Excel Using VBA - ExcelDemy
Works great but the pdf path will vary.
How can I have the user get a popup to select which file should get extracted, also is it possible to make this work on multiple files/have the user select multiple files at once.
Works great but the pdf path will vary.
How can I have the user get a popup to select which file should get extracted, also is it possible to make this work on multiple files/have the user select multiple files at once.
VBA Code:
Sub Extract_Data_from_PDF()
Set MyWorksheet = ActiveWorkbook.Worksheets("Sheet1")
Application_Path = "C:\Program Files (x86)\Adobe\Acrobat 9.0\Acrobat\Acrobat.exe"
PDF_Path = "C:\Users\Myname\Downloads\Statement_05_2022.pdf"
Shell_Path = Application_Path & " """ & PDF_Path & """"
Call Shell(pathname:=Shell_Path, windowstyle:=vbNormalFocus)
Application.Wait Now + TimeValue("0:00:03")
SendKeys "%vpc"
SendKeys "^a"
SendKeys "^c"
MyWorksheet.Range("A1").PasteSpecial Paste:=xlPasteAll
Call Shell("TaskKill /F /IM Acrobat.exe", vbHide)
End Sub