Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
opening a file in Excel starts application but dose not open file | Excel Discussion (Misc queries) | |||
File:1 and File:2 -- Double Files when Opening One File | Excel Discussion (Misc queries) | |||
opening an excel file opens a duplicate file of the same file | Excel Discussion (Misc queries) | |||
how do I activate links without opening external workbooks? | Excel Discussion (Misc queries) | |||
How do I reference external data from a file, file name found in . | Excel Discussion (Misc queries) |