closing PDF using excel VBA shell

berlinhammer

Board Regular
Joined
Jan 30, 2009
Messages
187
hello

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
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Forum statistics

Threads
1,215,432
Messages
6,124,857
Members
449,194
Latest member
HellScout

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top