Open pdf file using command buttong in excel [Solved/Closed]

Report
-
 IAN -
Hello,
i have a form in excel which retrieves details of a user from one of the worksheet. against tht user row, there is a pdf file name which basically is a pdf file sitting on a location on the network. I need to open the pdf file using a command button. below is the code used..but m getting an error "there is an error opening this document file cannot be found"



Path = ActiveSheet.Cells(9, 2) 'this is the main path where all pdf files will b stored which is on a network
'if the path is Z:\SMD Filing System\SMD\
fname = "scan0001.pdf"


retval = Shell("C:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe path&fname", 1)

5 replies

remember seeing ur post on another site..and tried that but doesnt work.

i now got it working as below

ActiveWorkbook.FollowHyperlink fpath & attach_name, NewWindow:=True
3
Thank you

A few words of thanks would be greatly appreciated. Add comment

CCM 5807 users have said thank you to us this month

thanks. I works. :)
Posts
261
Registration date
Saturday April 11, 2009
Status
Member
Last seen
June 21, 2011
306
Hi

Try this (not checked)

retval = Shell("C:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe " & path & fname, 1)

Do let me know If it helps...