VBA Code to Export PDF to Excel RRS feed

  • Question

  • Hi,

    Can i get a VBA Code to convert PDF file to Excel File



    Monday, April 17, 2017 10:16 AM

All replies

  • Gunti - No converter that I know of. You can display a pdf file on a worksheet via Insert/Object (also known as an OLEObject).
    A typical VBA statement:
    ActiveSheet.OLEObjects.Add("AcroExch.pdfxml.1", False, False).Activate

    -MainSleuth You've Got It, Use It! Engineering, Science, Statistics Solutions http://ToolSleuth.com. For any reply that either helps to answer your question or is the answer, please mark it as helpful or as the answer so others with the same question will have an answer quickly.

    Monday, April 17, 2017 1:41 PM
  • There is no easy way to get data from a PDF.  See if you can find the source used to create the PDF. 

    If you buy Adobe Acrobat ($$$) it has COM interface that you can call from VBA.  It has some features to extract info.

    All the free tools seem to be Python like PDFMiner.  I have used Calibre (book converter) to convert PDF to text and manually extract the parts I wanted.

    Monday, April 17, 2017 6:15 PM
  • You can use control AcroExch from Adobe, but that is from full version only (not reader).

    In office you can extract data using MS Word, and that works fine.

    That what it looks like:

    If you determinate you can reference to MS Word control in VBA Excel to do that, but that not, a fast and perfect way, because small differences in source can add data to another cells in the same PDF files. That's why MS do not add that mechanism to Excel is self. Than better way is using OCR programs like FineReader or others.

    Oskar Shon, Office System MVP - www.VBATools.pl
    if Helpful; Answer when a problem solved

    Wednesday, April 19, 2017 7:17 PM
  • Thursday, April 20, 2017 5:43 AM