View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default PDF to Excel as flat file, via macro

Much Joy exists..........I finally got there.......

Many thanks for all of your time and assistance arno

Vaya con Dios,
Chuck, CABGx3


"arno" wrote:

Hi,

write down exactly what you are typing when you do it manually,
including all ALT+TAB etc. Try to to use ALT-TAB to switch between
applications and do not close the reader.

Then use sendkeys with all the commands you have written and run it. I
thing this would be ALT+TAB, CTRL+c, ALT+TAB and then paste. Attention:
CTRL+C (which is actually CTRL+SHIFT+c) is different from CTRL+c. Eg. I
reload an Access query from Excel with:

Sub asAccess()
'ALT+TAB, Shift+F9 and ALT+TAB
Application.SendKeys ("%{TAB}")
Application.SendKeys ("+{F9}")
Application.SendKeys ("%{TAB}")
End Sub

Read vba help on Sendkeys for further information, there's everything
you need.

arno

"CLR" schrieb im Newsbeitrag
...
Still no joy in PDFland...........

I've tried
SendKeys "^(c)"
Application.SendKeys ("^c")
before, after, before and after, and in-between my recorded "open the

PDF
file" code, and still no luck........once the Reader is open, it just

does
not respond to any of my "SendKeys" code, but of course it will

respond to
typed Control-C, etc..........

Here's the code I use to open the file, and it works fine........

ActiveSheet.OLEObjects.Add(FileName:= _
"D:\MyPath\Monthly Variance Package 2005-01.pdf" _
, Link:=True, DisplayAsIcon:=False).Select
Selection.Verb

What I really want to do after opening the file is, Ctrl-A to "select

all",
Ctrl-C to "copy", Ctrl_q to "quit the application", then paste into

A1 in my
sheet............

Any further suggestions would be much appreciated........

Vaya con Dios,
Chuck, CABGx3


"arno" wrote in message
...
luck...it appears the SendKeys thing is not very user friendly

<g

what you need is:
Application.SendKeys ("^c")

arno