Macro to open Adobe Reader

GoodmanJim

Board Regular
Joined
Aug 24, 2003
Messages
95
I have a macro that opens a document in Abode Reader. Since Acrobat Reader DC is now a Web based program, I cannot open in this this line of a macro. It cannot find the program to open.

“& PicPath” is the file to open and worked before Abode changed the reader

This is the line that does not work.
Shell "C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe/open " & PicPath, vbNormalFocus

Thank you in advance for any help
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Re: Macro to open Abode Reaader

The following simple code may help you;

Code:
Sub Test()
    PicPath = "C:\TestFolder\myFile.pdf"
    ActiveWorkbook.FollowHyperlink "C:\TestFolder\myFile.pdf"
End Sub
 
Upvote 0
Re: Macro to open Abode Reaader

Please try this


Example of how to call the function
Code:
Sub OpenPrinterInstructionPDF()
  Dim RootFolder As String
  Dim A As String
  
  RootFolder = Sheets("Setup").Range("RootFolder")
  A = RootFolder & "\Zebra Printers\Install a new TAG printer Instructions.pdf"
  
  OpenAnyFile (A)
End Sub

Code:
Function OpenAnyFile(FileToOpen As String)
     
    Call ShellExecute(0, "Open", FileToOpen & vbNullString, _
    vbNullString, vbNullString, 1)
     
End Function
 
Upvote 0
Re: Macro to open Abode Reaader

I couldn't edit my post :confused::confused:

Using the PicPath variable;

Code:
Sub Test()
    PicPath = "C:\TestFolder\myFile.pdf"
    ActiveWorkbook.FollowHyperlink PicPath
End Sub

This will open the file defined in the variable "PicPath" by the associated program with PDF files in your PC.

This means that; if Adobe Reader is associated with PDF files, the file will be opened by it.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top