Open files from a dynamic path..
Nick,
Sorry to bother you again..
I tried to insert the code, unfortunalty there's a compile-error which
states that
it expects a rulenumber or a name or a instruction or a instruction-end..
I do have to put the code in the command button sub? Or do I make a mistake?
--
Arjan Bregman
*****
the knowledge is always there, maybe hidden, but it is there..
*****
"NickHK" wrote:
If you just want to open them in the user's defualt app for pdf files :
Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA"
_
(ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
ShellExecute 0, "open", Thisworkbook.path & "\YourPDF.pdf", "", "", 1
NickHK
"Arjan" wrote in message
...
Nick,
Thanks for your reply.. The files are in the same path as the workbook.
However, what I don't know is the how to open the file(s)..
what code do I have to use?
Arjan
--
Arjan Bregman
*****
the knowledge is always there, maybe hidden, but it is there..
*****
"NickHK" wrote:
Arjan,
Depends where the PDFs are relative to the Excel WB. You already have
ThisWorkbook.Path, so if they in a sub folder of that :
ThisWorkbook.Path & "\PDF_Folder\PDF1.pdf"
If you maybe on Mac then you would need to do bit work at detecting that
first.
NickHK
"Arjan" wrote in message
...
Hi al..
I have a problem.. I placed the question here last week aswell,
unfortunatly
it did not solve my problem..
Scope:
I have a userform where I would like to add some buttons wich open
certain
adobe PDF files. Furthermore, this project is to be burned on a CD so
it
can
be distributed.
My problem are the drive letters.. (diffrent systems, diffrent drive
letters..)
this is the code i'm using..
_______________
Private Sub CommandButton19_Click()
'open pdf file
Dim filelocation As String
filelocation = ThisWorkbook.Path
_________________
I'm missing the last part where I call the variable filelocation and
open
the pdf file..
Who can help me out?
--
Arjan Bregman
*****
the knowledge is always there, maybe hidden, but it is there..
*****
|