LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Opening PDFs from VBA??

Hi All,

I am write a simple macro to open a PDF from VBA, but I want the name
of the PDF and location of the PDF as a string value, such that one
could assign the macro to a button in excel and use it when needed.

So far I have:

Sub pdfVBA()
Dim pdfLoc, pdfName As String

'change this to location of directory
pdfLoc = "M:\"

pdfName = ActiveCell.Value

Shell "C:\Program Files\Adobe\Acrobat 5.0\Acrobat\Acrobat.exe" & _
pdfLoc & pdfName, 1

End Sub

But I am receiving an "File not found" error. I suspect I has
something to do with using the string values, because when I replace
pdfLoc and pdfName with the location and file the code works.

Thanks for any help in advance
Eugene
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Controling Acrobat PDFs YS Excel Discussion (Misc queries) 1 December 18th 04 10:47 AM
Relative Hyperlinks to PDFs (or other documents) || cypher || Excel Discussion (Misc queries) 1 November 30th 04 03:05 AM
Relative Hyperlinks to PDFs (and other documents) || cypher || Links and Linking in Excel 0 November 30th 04 02:01 AM
Printing one Adobe pdf instead of multiple pdfs universal[_27_] Excel Programming 1 April 7th 04 01:16 PM
Loading PDFs, Shell Function Paul Martin Excel Programming 5 July 31st 03 02:52 AM


All times are GMT +1. The time now is 01:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"