PDF won't open from excel file

  • Thread starter Thread starter oltersdorf
  • Start date Start date
O

oltersdorf

Hello, I hope you can help me out. I have a link to a local PDF file in
excel. This PDF file will open fine from Adobe or from my documents,
but when I click on the link in excel, the screen flashes momentarily,
but the file does not open.

I do not experience this problem when linking to word files, etc. This
file is not embeded... just linked.

please advise\.

Thank you!!
 
Hi

There were problems I believe with Version 7.0
Update it to 7.03 and try it again
 
The computer currently has Acrobat 6.o and reader 7.0. We can obviously
upgrade reader free of charge, but could it be Acrobat 6.0 that is
causing the problem??
 
Good evening (e-mail address removed)

I too have come up against this problem and believe that while Excel
can open other Office docs and .exes without problem it doesn't like
opening pdf files as it doesn't seem "aware" of what program should be
opening them - as Excel can't read them anyway. Another possible
problem (if the file is going to be used by other people than yourself)
is that the user may not actually be using Acrobat to read the pdf
file.

The solution is to use an API call to get Excel to open the file using
its default program viewer. Make this the top line of your code:

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

and then at the point you want to call the pdf use this line:

ShellExecute 0, vbNullString, "MyAcrobatDoc.pdf", vbNullString,
"c:\Mypath\", 1

obviously, where MyAcrobatDoc.pdf is the file you want to open and
c:\Mypath\ is the path to the document.

HTH

DominicB
 
Back
Top