VBA: close Adobe Reader

J

Jan Prins

I have created a PDF file out of Excel and Adobe Reader is automatic opened.
I want to close Adobe Reader by VBA code.

Under references I have added the Adobe library.
I use this code but it doesn't work.
Can somebody help me please?
Jan Prins

Sub closeAdobe()
Dim wdobj As Acrobat.AcroApp
On Error GoTo foutmelding
Set wdobj = GetObject(, "Adobe Reader")

With wdobj
.Show
.Exit
End With

Exit Sub
foutmelding:
MsgBox "Cannot close Adobe"
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top