Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old July 29th 03, 10:51 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Oct 2006
Posts: 114
Default Loading PDFs, Shell Function

Hi guys

- I am attempting to load a pdf using the following code:

iStatus = Shell(sDirAndFilePath, vbMaximizedFocus)

- I'm using an API call that successfully returns the Acrobat installation
directory on different computers.

- On one computer, sDirAndFilePath="C:\Program Files\Adobe\Acrobat 5.0\
Acrobat\Acrobat.exe C:\test.pdf" and this works fine.

- On another computer, sDirAndFilePath="C:\Program Files\Adobe\Acrobat 4.0\
Acrobat\Acrobat.exe C:\test.pdf" but this returns an error in Acrobat "File
not found", even though no error is detected in VB.

- On the surace, it appears to be a version issue with Acrobat 4.0, but I don't
know how feasible this is. Does a PDF loaded with v4 require different
syntax to later versions of Acrobat? Any suggestions are appreciated.

Thanks in advance.

Paul Martin
Melbourne, Australia

  #2   Report Post  
Old July 30th 03, 02:38 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Jul 2003
Posts: 2,824
Default Loading PDFs, Shell Function

This might not work for you, but why not just start the .pdf file itself. Let
windows find the associated program:

Shell("start C:\test.pdf")

My expertise with API consists of copying and pasting. But did you look at
FindExecutable in your API books?


Paul Martin wrote:

Hi guys

- I am attempting to load a pdf using the following code:

iStatus = Shell(sDirAndFilePath, vbMaximizedFocus)

- I'm using an API call that successfully returns the Acrobat installation
directory on different computers.

- On one computer, sDirAndFilePath="C:\Program Files\Adobe\Acrobat 5.0\
Acrobat\Acrobat.exe C:\test.pdf" and this works fine.

- On another computer, sDirAndFilePath="C:\Program Files\Adobe\Acrobat 4.0\
Acrobat\Acrobat.exe C:\test.pdf" but this returns an error in Acrobat "File
not found", even though no error is detected in VB.

- On the surace, it appears to be a version issue with Acrobat 4.0, but I don't
know how feasible this is. Does a PDF loaded with v4 require different
syntax to later versions of Acrobat? Any suggestions are appreciated.

Thanks in advance.

Paul Martin
Melbourne, Australia


--

Dave Peterson

  #3   Report Post  
Old July 30th 03, 04:48 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Oct 2006
Posts: 114
Default Loading PDFs, Shell Function

Thanks Dave but your suggestion returns error 54: can't find file.

It appears to be neither an OS nor Acrobat version issue. I have two
computers, both Win98, both with Acrobat v4. One works, one doesn't. I
think maybe I need to reinstal Acrobat on the one that doesn't work.

If anyone has any other illuminations, that'd be great.

Regards

Paul Martin
Melbourne, Australia

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #4   Report Post  
Old July 30th 03, 05:03 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Jul 2003
Posts: 2,824
Default Loading PDFs, Shell Function

Is the c:\test.pdf missing or the adobe executable?

When you run the same command from a DOS prompt, what do you get?
start C:\test.pdf


Paul Martin wrote:

Thanks Dave but your suggestion returns error 54: can't find file.

It appears to be neither an OS nor Acrobat version issue. I have two
computers, both Win98, both with Acrobat v4. One works, one doesn't. I
think maybe I need to reinstal Acrobat on the one that doesn't work.

If anyone has any other illuminations, that'd be great.

Regards

Paul Martin
Melbourne, Australia

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


--

Dave Peterson

  #5   Report Post  
Old July 30th 03, 11:08 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Oct 2006
Posts: 114
Default Loading PDFs, Shell Function

Dave

Your suggestion loads a new dos box with a box title of the filename.

I have since uninstalled Acrobat v4 and reinstalled it to no effect. I
then installed Acrobat Reader v5 which fixed it. I then uninstalled
Reader v5 and installed Acrobat v5 and it still worked. I then
uninstalled Acrobat v5 and installed Acrobat v4 and the problem returned
(even though I have it working on other machines with Acrobat v4).

Regards

Paul Martin
Melbourne, Australia

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


  #6   Report Post  
Old July 31st 03, 02:52 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Jul 2003
Posts: 2,824
Default Loading PDFs, Shell Function

It _kind of_ sounds like a file association (well, from a distance).


When it's broken, in windows explorer: try shiftright clicking on the .pdf file
and select OpenWith.

Browse to the version of acrobat (AcroRd32.exe???) and check to always use that
program for that file type.

It might fix something...(or might not have any affect).



Paul Martin wrote:

Dave

Your suggestion loads a new dos box with a box title of the filename.

I have since uninstalled Acrobat v4 and reinstalled it to no effect. I
then installed Acrobat Reader v5 which fixed it. I then uninstalled
Reader v5 and installed Acrobat v5 and it still worked. I then
uninstalled Acrobat v5 and installed Acrobat v4 and the problem returned
(even though I have it working on other machines with Acrobat v4).

Regards

Paul Martin
Melbourne, Australia

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


--

Dave Peterson



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
Running Shell Jeff Excel Discussion (Misc queries) 0 January 28th 08 04:50 PM
Is it possible to Shell and remove Excel from memory? alainB Excel Discussion (Misc queries) 3 August 2nd 06 04:16 PM
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
use shell function in vbscript Sofia Excel Programming 0 July 21st 03 06:29 PM


All times are GMT +1. The time now is 09:03 PM.

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

About Us

"It's about Microsoft Excel"

 

Copyright © 2017