Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-08-2017, 11:44 AM
sathishsusa sathishsusa is offline Extract column from Pdf to Excel file Windows 7 64bit Extract column from Pdf to Excel file Office 2016
Novice
Extract column from Pdf to Excel file
 
Join Date: May 2017
Posts: 10
sathishsusa is on a distinguished road
Default

Quote:
Originally Posted by charlesdh View Post
Hi,

If you can not edit the PDF file then I do not think you will be able to do as you want.
HI charlesdh,

Many thanks after a long time i got the reply. yes its difficult convert from PDF to Excel but here i tried with some vba code to transfer from PDF to excel.



First will convert to word and then it will copy to excel sheet the code was working fine in Word file but after import to excel file the column display is not showing correct. at least i dont want all the data to copy in excel i need only specific column to data to transfer in excel if possible have a look to solve this problems please..


Code:
Sub read_pdf_document_tables()

Const PDFPath As String = "C:\Users\u\Downloads\maximoreport\ORIGINAL FILE.pdf"

Dim sht As Worksheet
Dim WDoc As Word.Document
Dim WApp As Word.Application
Dim i As Long, r As Long, c As Long
Dim rng As Range, t As Word.Table

    Set WApp = CreateObject("Word.Application")
    WApp.Visible = True
    Set WDoc = WApp.Documents.Open(PDFPath, ConfirmConversions:=False, ReadOnly:=False)

    Set sht = Sheets("Temp")
    Set rng = sht.Range("A1")
    sht.Activate

    For Each t In WDoc.Tables
        t.Range.Copy
        rng.Select
        
        rng.Parent.PasteSpecial Format:="Text", Link:=False, DisplayAsIcon:=False
        With rng.Resize(t.Rows.Count, t.Columns.Count)
            .Orientation = xlLandscape
            .Cells.UnMerge
            Cells.Columns.AutoFit
            Cells.Rows.AutoFit
        End With

        Set rng = rng.Offset(t.Rows.Count + 2, 0)
    Next t
    WDoc.Close 'word file will close
    WApp.Quit   ' word file will close
End Sub
Reply With Quote
Reply

Tags
excel vba acceleration



Similar Threads
Thread Thread Starter Forum Replies Last Post
Extract data based on pattern with respect to specific column PRA007 Excel Programming 14 12-04-2015 04:32 AM
Macro to highlight repeated words in word file and extract into excel file aabri Word VBA 1 06-14-2015 07:20 AM
Extract column from Pdf to Excel file How do I extract all my email addresses into one file? JohnFurter Outlook 3 05-16-2015 04:32 AM
Extract column from Pdf to Excel file Extract phone number from word file donlincolnmsof Word VBA 12 06-19-2012 05:21 PM
Extract column from Pdf to Excel file Extract Video from .ppsx file designer PowerPoint 1 10-14-2011 08:00 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:20 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft