Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 54
Default Opening An External File

I am trying to write what should be a fairly simple thing....

I need the user to be able to select a report thorugh drop down menus,
then an example of this is shown on the screen, I can do this using
one of J.E. McGimpsey's brilliant macros.

I would then like thbe user to be able to click a buttone and the
actual report (usualy pdf) to open, not to hard I thought........

I have a total of 80 reports all stored in the one file with sensible
names.

Can anyone help ?

Matthew
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Opening An External File

You need to use the shell command and specify the complete path of where the
adobe reader is located on your PC. Note the is a space between the adobe
path and the file name

Adobe = "C:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe"
Shell (Adobe & " c:\temp\bell.pdf")


Adobe may be located in a different location on your PC. You may need to
search the c drive to find where adobe is located if you plan to use the
macro on other PC's.

You can use filesearch for locating the adobe reader. I'm searching the
entire c: drive. You may want to use a path like "C:\Program Files instead
of c:.


msgbox("Searching for adobe - this may take a couple of minutes")
With Application.FileSearch
.NewSearch
.LookIn = "C:\"
.SearchSubFolders = True
.Filename = "AcroRd32.exe"
.MatchTextExactly = True
.FileType = msoFileTypeAllFiles
If .Execute() = 0 Then
MsgBox ("Cannot find adobe - exiting macro")
Exit Sub
Else
adobe = .FoundFiles.Item(1)

End If
End With




"Matthew" wrote:

I am trying to write what should be a fairly simple thing....

I need the user to be able to select a report thorugh drop down menus,
then an example of this is shown on the screen, I can do this using
one of J.E. McGimpsey's brilliant macros.

I would then like thbe user to be able to click a buttone and the
actual report (usualy pdf) to open, not to hard I thought........

I have a total of 80 reports all stored in the one file with sensible
names.

Can anyone help ?

Matthew

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 54
Default Opening An External File

On 4 Oct, 21:26, Joel wrote:
You need to use the shell command and specify the complete path of where the
adobe reader is located on your PC. *Note the is a space between the adobe
path and the file name

Adobe = "C:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe"
Shell (Adobe & " c:\temp\bell.pdf")

Adobe may be located in a different location on your PC. *You may need to
search the c drive to find where adobe is located if you plan to use the
macro on other PC's.

You can use filesearch for locating the adobe reader. *I'm searching the
entire c: drive. *You may want to use a path like "C:\Program Files instead
of c:.

msgbox("Searching for adobe - this may take a couple of minutes")
With Application.FileSearch
* * .NewSearch
* * .LookIn = "C:\"
* * .SearchSubFolders = True
* * .Filename = "AcroRd32.exe"
* * .MatchTextExactly = True
* * .FileType = msoFileTypeAllFiles
* * If .Execute() = 0 Then
* * * *MsgBox ("Cannot find adobe - exiting macro")
* * * *Exit Sub
* * Else
* * * *adobe = .FoundFiles.Item(1)

* * End If
End With

"Matthew" wrote:
I am trying to write what should be a fairly simple thing....


I need the user to be able to select a report thorugh drop down menus,
then an example of this is shown on the screen, I can do this using
one of J.E. McGimpsey's brilliant macros.


I would then like thbe user to be able to click a buttone and the
actual report (usualy pdf) to open, not to hard I thought........


I have a total of 80 reports all stored in the one file with sensible
names.


Can anyone help ?


Matthew


Wowsie, I guessed it was tough.......in the end I have cheated a
little and put a 'fix' in.
Thanks for your help though all is stored away for when I run out of
ideas !!!
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Opening An External File

I found a better method in a posting today. Much easier to impliment

retValue = Shell("C:\Windows\explorer.exe c:\temp\test.pdf", vbNormalFocus)

the file name is in the shell and will automatically open the PDF in a
window explorer in an IE explorer type window. Don't need to find where the
adobe application is located.

"Matthew" wrote:

On 4 Oct, 21:26, Joel wrote:
You need to use the shell command and specify the complete path of where the
adobe reader is located on your PC. Note the is a space between the adobe
path and the file name

Adobe = "C:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe"
Shell (Adobe & " c:\temp\bell.pdf")

Adobe may be located in a different location on your PC. You may need to
search the c drive to find where adobe is located if you plan to use the
macro on other PC's.

You can use filesearch for locating the adobe reader. I'm searching the
entire c: drive. You may want to use a path like "C:\Program Files instead
of c:.

msgbox("Searching for adobe - this may take a couple of minutes")
With Application.FileSearch
.NewSearch
.LookIn = "C:\"
.SearchSubFolders = True
.Filename = "AcroRd32.exe"
.MatchTextExactly = True
.FileType = msoFileTypeAllFiles
If .Execute() = 0 Then
MsgBox ("Cannot find adobe - exiting macro")
Exit Sub
Else
adobe = .FoundFiles.Item(1)

End If
End With

"Matthew" wrote:
I am trying to write what should be a fairly simple thing....


I need the user to be able to select a report thorugh drop down menus,
then an example of this is shown on the screen, I can do this using
one of J.E. McGimpsey's brilliant macros.


I would then like thbe user to be able to click a buttone and the
actual report (usualy pdf) to open, not to hard I thought........


I have a total of 80 reports all stored in the one file with sensible
names.


Can anyone help ?


Matthew


Wowsie, I guessed it was tough.......in the end I have cheated a
little and put a 'fix' in.
Thanks for your help though all is stored away for when I run out of
ideas !!!

Reply
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
opening a file in Excel starts application but dose not open file Bob Shelton Excel Discussion (Misc queries) 1 July 2nd 08 07:51 PM
File:1 and File:2 -- Double Files when Opening One File dallin Excel Discussion (Misc queries) 1 January 25th 07 02:53 AM
opening an excel file opens a duplicate file of the same file skm Excel Discussion (Misc queries) 1 December 7th 05 05:52 PM
how do I activate links without opening external workbooks? teh_chucksta Excel Discussion (Misc queries) 0 August 29th 05 11:22 PM
How do I reference external data from a file, file name found in . Clux Excel Discussion (Misc queries) 1 February 10th 05 10:52 PM


All times are GMT +1. The time now is 04:25 PM.

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

About Us

"It's about Microsoft Excel"