• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to copy Pdf file data in Excel

Abhijeet

Active Member
Hi
I ahve this macro but this is not work
Code:
Sub method1_using_sendkey()
Dim task
' open the file
' change the path of adobe program as per your desktop
task = Shell("C:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe " & "C:\Documents and Settings\user\Desktop\Pdf to excel test.pdf", vbNormalFocus)
' wait 2 secs
Application.Wait Now + TimeValue("00:00:2")
'send key to select all text
SendKeys "^a", True
' wait 2 secs
Application.Wait Now + TimeValue("00:00:2")
' send key to copy
SendKeys "^c"
' wait 2 secs
Application.Wait Now + TimeValue("00:00:2")
' activate this workook and paste the data
Windows("Pdf to Excel.xlsm").Activate
Range("a2").Select
ActiveSheet.Paste
' Activate notepad
AppActivate task
' send key to close pdf file
SendKeys "^q"
MsgBox "done"
End Sub

can u tell me how to copy data from Pdf file to excel.please give me macro
 
Last edited by a moderator:
This
...but this is not work
does not help us in the least bit know what went wrong. Why doesn't the macro work? It won't run at all? It runs, but gives an error? Wrong info getting copied?
 
Hi Luke M give me macro copy pdf file data in Excel i do not know why this not work please give me macro
 
Hi i have this macro but after run error getting in this line Set AC_PD = New Acrobat.AcroPDDoc.please help
 

Attachments

  • PDF2Excel.xls
    63 KB · Views: 39
Macro is working perfectly on my machine...
I hit the Import button, select a PDF, select import into Excel, then click Import. Is the PDF you are trying to import protected or some other oddity?
 
You can't do that. In a PDF, none of the spacing is stored as viable text, it's just little block scattered along the page. When you copy from it, you get all the data in a single line in XL.
 

Attachments

  • PDF2Excel_output.xls
    68 KB · Views: 41
Its not look like pdf data i upload the excel file its show like pdf file data is this possible in VBA Macro to pull data from pdf to excel
 
As I said before...
You can't do that. In a PDF, none of the spacing is stored as viable text, it's just little block scattered along the page. When you copy from it, you get all the data in a single line in XL.
 
Macro is working perfectly on my machine...
I hit the Import button, select a PDF, select import into Excel, then click Import. Is the PDF you are trying to import protected or some other oddity?


Hi Luke,

I have some clarification about PDF to Excel. Here I posted one pdf and needed output excel. How to implement this pdf in your given macro. could you clarify for the same and i need to convert more pdf pages using this macro.

Regards,
Sampath.S
 

Attachments

  • Data Conversion.zip
    96.2 KB · Views: 15
Hi Sampath,
I don't think we can automate this type of import, with free floating text in a 'graphical' layout'. While the importer can grab all the text, it will just get very confused as to the layout/order of the text. :(
 
Hi Luke,

Thanks for your reply. I need another type of output. That output type sample has attached here. This is the copy & paste procedure from pdf to excel. Is there any possibility for your macro? Kindly provide for the same.

Note : I have more sheets (upto 300 pages) in this pdf.

Regards,
Sampath.S
 

Attachments

  • Data Conversion.zip
    96.2 KB · Views: 14
As I said before, I don't think we can automate this import. As the PDF is more of a graphical image than a word document, any "text grabber" isn't going to keep things lined up. :(
 
Hi Luke.

Got only alphanumeric in excel, while copy that PDF page (Ctrl+C) and paste it in excel sheet(Ctrl+V). Does not paste graphical image and graphical image code in excel. That kind of process only need in macro for all sheets. if it not possible, please suggest any portable text grabber for this process.

Thanks and Regards,
Sampath.S
 
Back
Top