extract data from pdf to Excel worksheet

mortenhp

New Member
Joined
Sep 17, 2018
Messages
3
Is it possible to extract data from a pdf to Excel using VBA? I only have Adobe reader installed as a pdf viewer and I already have tried some different code but it comes up with an error message saying it can´t find the file everytime.
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
The following uses Adobe Acrobat Reader - a free download from Adobe.

Be certain you change the PATHS to match your system. Also note that the PDF file in the code is hardcoded. You can change that to an INPUT box value
or something you enter into a specified cell as a value.

Code:
Sub StartAdobe2()
Dim AdobeApp As String
Dim AdobeFile As String
Dim StartAdobe
 
AdobeApp = "C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe"
AdobeFile = "C:\Users\My\Desktop\AC_103-6.pdf"
 
StartAdobe = Shell("" & AdobeApp & " " & AdobeFile & "", 1)
 
Application.Wait (Now + TimeValue("0:00:03"))


SendKeys ("^a")
SendKeys ("^c")
 
Application.Wait (Now + TimeValue("0:00:05"))
SendKeys ("%fx")
AppActivate "Microsoft Excel"
ThisWorkbook.Activate
Sheets(1).Activate
Range("A1").Activate
SendKeys ("^v")
End Sub


Download workbook : https://www.amazon.com/clouddrive/share/mOgWNrt4TDukamn0PXlZRz1c5oT72wbTt6JvZYVscQA
 
Upvote 0
Thanks! but I have tried that one before and it gives me an error on the appactivate"Microsoft Excel" when i debug. I don´t know why but I have the 2016 version of Excel
 
Upvote 0
Sorry, I'm using Excel 2007.

Not certain what the difference would be.
 
Upvote 0

Forum statistics

Threads
1,223,754
Messages
6,174,311
Members
452,554
Latest member
Louis1225

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top