• 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.

Copy data from pdf to excel

venkat5652

New Member
Hi team,

Need help in copy data from pdf to excel in same pdf file format using macro.
 

Attachments

  • Togo.pdf
    138.7 KB · Views: 13
Hello Venkat.

Yes it is possible by using Send keys option..Let me give a try!
 
Hello Venkat.

Try this!

Code:
Sub Test()
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\Monty.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("Monty.xlsm").Activate
Range("a2").Select
ActiveSheet.Paste

' Activate notepad
AppActivate task

' send key to close pdf file
SendKeys "^q"
MsgBox "Venkat it's done"
End Sub
 
Hi !

As it depends on the pdf tool used,
just perform a web search on this subject
as there are as many ways as tools …

Other solution : better is to work from original file, not from pdf.
Ask for workbook instead …

The Copy / Paste way like Monty can not keep format.
 
Back
Top