Opening a PDF from an Excel User-Form

V

Viswanath Tumu

I need to place a button on a User Form when clicked will open a pd
file that is embedded into the main file. I am able to do this in
regular spreadsheet by inserting a ‘package’ object. When the button i
clicked the following is code is called and the pdf opens from Excel.

The code is:

Dim zx As Worksheet
Set zx = ThisWorkbook.Sheets("sheet1")

Application.DisplayAlerts = False
zx.Shapes("Object 2").Select
Selection.Verb Verb:=xlPrimary

However, this code is not working with an add-in. The line that i
generating an error is ‘selection.verb’.

Is there a special tool in the control tool box that I can use as
container for a pdf? Greatly appreciate any help
 
B

BrianB

You might find this method better :-

'-----------------------------------------------
Sub Open_PDF()
Dim App As String
Dim MyFile As String
Q = Chr(34) 'quote
App = "C:\Program Files\Adobe\Acrobat 4.0\Reader\AcroRd32.exe"
MyFile = Q & "c:\program files\adobe\acroba
4.0\help\ENU\acrobat.pdf" & Q
x = Shell(App & " " & MyFile, 1)
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