mrinal saha
Board Regular
- Joined
- Jan 20, 2009
- Messages
- 229
Hi folks,
I have been trying to execute the below code but unble to do so...Issue is code is running without any error but giving no result. It is opening the pdf file but not copying the data and pasting it into excel..
And any idea if I have to do this with multiple pdf files than how to go about it?
Sub pdf_test()
Dim obj As Variant
Dim ws As Worksheet
Set ws = ActiveSheet
obj = Shell("C:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe C:\Documents and Settings\287940\Desktop\Test Macros\Mrinal Saha.pdf")
'wait time to open the adobe
Application.Wait (Now + TimeSerial(0, 0, 2))
'Application.OnTime Now + TimeValue("00:00:02")
'select all
SendKeys ("^a")
'copy the data
SendKeys ("^c")
'close the shell app
SendKeys ("%{F4}")
AppActivate "Microsoft Excel"
ws.Range("a2").Select
'paste the data
SendKeys ("^v")
End Sub
Thanksss,
Mrinal
I have been trying to execute the below code but unble to do so...Issue is code is running without any error but giving no result. It is opening the pdf file but not copying the data and pasting it into excel..
And any idea if I have to do this with multiple pdf files than how to go about it?
Sub pdf_test()
Dim obj As Variant
Dim ws As Worksheet
Set ws = ActiveSheet
obj = Shell("C:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe C:\Documents and Settings\287940\Desktop\Test Macros\Mrinal Saha.pdf")
'wait time to open the adobe
Application.Wait (Now + TimeSerial(0, 0, 2))
'Application.OnTime Now + TimeValue("00:00:02")
'select all
SendKeys ("^a")
'copy the data
SendKeys ("^c")
'close the shell app
SendKeys ("%{F4}")
AppActivate "Microsoft Excel"
ws.Range("a2").Select
'paste the data
SendKeys ("^v")
End Sub
Thanksss,
Mrinal
Last edited: