berlinhammer
Board Regular
- Joined
- Jan 30, 2009
- Messages
- 187
hello
I am trying to automate the opening, copying, pasting (into excel) and closing of a daily PDF document. I have been trying to avoid downlaods and converters as what I need to do is so simple, I'm finding it a nightmare and falling at the last hurdle. I only have a free PDF reader, we haven't got premium Acrobat.
The above code is opening, copying and pasting using keyboard emulation and shell mainly. Does anyone know how I can get rid of the PDF once I've got its contents in my Excel sheet?
Thank you!
Jon
Code:
Sub PressControlA()
PressKeyVK keyControl, True
PressKey "a"
PressKeyVK keyControl, , True
End Sub
Sub PressControlC()
PressKeyVK keyControl, True
PressKey "c"
PressKeyVK keyControl, , True
End Sub
Sub opencopypasteclosepdf()
Shell """" & "C:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe" & """ /o """ & "S:\Data Dept\Excel Widgets\Wertpapier Mitteilungen\To Process\Teil_IIa_04.01.2010.pdf", vbNormalFocus
PressControlA
Application.Wait DateAdd("s", 5, Now)
PressControlC
Application.Wait DateAdd("s", 20, Now)
Application.ActiveCell.PasteSpecial xlPasteAll
'now how do i close the PDF???
End Sub
I am trying to automate the opening, copying, pasting (into excel) and closing of a daily PDF document. I have been trying to avoid downlaods and converters as what I need to do is so simple, I'm finding it a nightmare and falling at the last hurdle. I only have a free PDF reader, we haven't got premium Acrobat.
The above code is opening, copying and pasting using keyboard emulation and shell mainly. Does anyone know how I can get rid of the PDF once I've got its contents in my Excel sheet?
Thank you!
Jon