Linking to a Specific Page in a PDF File

by Allen Wyatt
(last updated February 24, 2015)


Gary wants to link from an Excel worksheet to a specific page in a PDF file. He can get Excel to link to the PDF but it starts on the first page of the PDF, not the page he wants. Gary believes that Excel is ignoring the PDF command that tells it the page he wants. As an example, he can use the formula =HYPERLINK("E:\\test\gary.pdf#5") and Excel ignores the #5 part and opens to the first page of the PDF.

This does, indeed, seem to be the case, Gary. The HYPERLINK worksheet function seems to ignore the page specification for some strange reason. There also doesn't seem to be a way around this problem with the function.

Fortunately, you can use a macro to do the opening, if you desire. The following macro relies upon Internet Explorer to open the PDF and display the proper page:

Sub OpenPDFpage()
    Dim myLink As String
    Dim TargetPage As Double
    Dim objIE As New InternetExplorer

    myLink = "path/filename.pdf"
    TargetPage = 7   'Page number to be shown

    With objIE
        .Navigate myLink & "#page=" & TargetPage
        .Visible = True
    End With
End Sub

The code could also be rather easily changed to a function to which you can pass the desired path and target page.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (3350) applies to Microsoft Excel 97, 2000, 2002, and 2003.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...


Drop Shadows for Tables

When adding borders and shading to a document's elements, Word allows you to quickly add drop shadows to paragraphs, text ...

Discover More

Getting Rid of All TA Fields

The first step in creating a table of authorities is to mark citations throughour your document. If you want to get rid of ...

Discover More

Understanding the Gutter Margin

Most everyone knows that Word allows you to set top, bottom, left, and right margins for your document. There is another type ...

Discover More

Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!


Hyperlinks that Open in a Different Browser Window

When you click a link in a browser, the target of that link might open in the same window or in a new window. Getting an ...

Discover More

Get Rid of Web Stuff

When you copy information from a Web page and paste it into a worksheet, you can end up with more than you bargained for. ...

Discover More

References to Hyperlinks aren't Hyperlinks

Make a reference to a hyperlink in a formula, and you may be surprised that the reference doesn't return an active hyperlink. ...

Discover More

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments for this tip:

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is nine more than 2?

2016-11-28 10:44:04


I'm desperately trying to get this to work using Excel 2016 with no luck. With the code as is (substituting my local file path and name) I get a compile error at 'Dim objIE As New InternetExplorer' saying 'User defined type not defined'. I would dearly love this to work as a function so I could pass the page parameter. Any thoughts on getting it working. Many thanks.

2016-05-24 11:31:56


Hi Allen
No success for Excel 2010. PDF-file is ever open on the page 1. Also another parameters as zoom etc. are ignored.
A relatively positive message is, that in Excel 2013 it works completely OK.
Is there something wrong with my Excel 2010?

2016-01-14 21:31:36


How can I do this is Excel

1. How to create a hyperlink from a scanned pdf file saved in my local folder

Invoice: Amount: Scanned Invoice Pdf:
123 $2,000 SIPDF12345
124 $2,000 SIPDF12346

Will there be a macro wherein it will automatically open the pdf file from scanned invoice pdf folder saved in local folder(e.g.,SIPDF12345 & SIPDF12346).

2015-08-04 10:50:57


How do I convert the code in the original posting to a function?

I need to open multiple PDF files to different page numbers in the same workbook and I would like to create a function. I need them to open from my local drive and would like them to open using a function so that other users of the function do not need to alter the source code in excel.

I have it working right now where it opens in Windows Explorer, but that does not allow the users to edit the PDF document once open.

Here is my function that works for Windows Explorer:


Here is the source code behind it: (How do I change it so that it opens the Adobe Reader or Acrobat instead of IE?)

Function GoToPDFpage(Fname As String, pg As Integer)

Set IE = CreateObject("InternetExplorer.Application")

With app
.Navigate Fname & "#page=" & pg
.Visible = True
End With
End Function

Please help! Thanks,

2015-05-04 04:06:44


Hi there, thank you all for valuable tips. In fact, the hyperlink function works well for me and I can open the pdf file at the desired page using the =hyperlink("E:testgary.pdf#page=5") line. However, is there a way to take a number, say ‘5’, automatically from another column and implement it in the formula? This would let me to avoid editing the hyperlinks once in a cell.
Thanks in advance!

2015-02-12 20:54:59


How can I hyperlink to a certain page of a PDF document if I have embedded that PDF within my Excel spreadsheet?

2014-12-19 17:36:39


Attempted to replicate Richard Chapman experiment, but could not get the link to go to a specific page. It always opens on page 1 using


Using Excel 2010.

2014-11-06 05:34:43


Hey guys,
One of the ways I did this as I was hyperlinking an excel doc to a specific page in a PDF. I save the PDF on the page that I wanted. Then I hyperlinked it. As long as the PDF doesn't get saved again on a different page or you don't need multiple specific pages then this may be good for you. Good luck

2014-10-07 13:00:58


There is a way i figured out where you can use the #page=[page#]. without vb! the catch is that you have to have the excel file on the same drive as the file you are linking it to.


in the command for the cell =(hyperlink"","")

\[drive][file path]
insetead of

this is the only things that has worked for me

2014-09-28 20:00:10


let excel write and run a batch file to open the pdf. Edit the file paths and if you are bothered about leaving the bat file move the kill command to a workbook close event.

Sub WriteAndRunBatFile()
Dim retVal
strFilePath = "c:folderpdf.bat"
pg = 2
Open strFilePath For Output As #1
Print #1, "Start /Max /w " & Chr(34) & "Current E-book" & Chr(34) & " " & Chr(34) & "C:Program Files (x86)AdobeReader 11.0ReaderAcroRd32.exe" & Chr(34) & " /a " & Chr(34) & "page=" & pg & Chr(34) & " " & Chr(34) & "H:DocumentsRPGDragonlanceNew folderSample File.pdf" & Chr(34) & ""
Close #1
retVal = Shell(strFilePath)
'Kill strFilePath
End Sub

2014-09-21 22:39:48

Richard Plant

SORRY, but Excel 2010 using the HYPERLINK() and specifying the page number using the #page=5 DOES NOT WORK. I have tried this numerous different ways with different files and it just does NOT work. DOES anyone have a way to Hyperlink() to a PDF file and go to a SPECIFIC PAGE?

2014-08-21 07:40:58


I have a Excel that I am trying to add hyperlinks to go to a specific page on a pdf file. How do I do that with vba macro?

2014-07-16 07:12:36

Michael (Micky) Avidan

To my opinion, the shorest and simplest macro, to open a saved PDF file in page 4, will be:
Sub Micky()
App_Path = "C:Program FilesAdobeReader 10.0ReaderAcroRd32.exe"
File_Path = "D:TEST444.pdf"
Page_Num = 4
Shell App_Path & " /A Page=" & Page_Num & " " & File_Path, vbMaximizedFocus
End Sub
Michael (Micky) Avidan
“Microsoft® Answers" - Wiki author & Forums Moderator
“Microsoft®” MVP – Excel (2009-2015)

2014-07-15 13:15:31


To echo AW's comment, the HYPERLINK("file.pdf#page=3","clicktoseePg3") does not open to page 3 of the named PDF document, it brings up only page 1 of the same document.

2014-07-15 03:17:36


The above method does not work if you print out as PDF using the Adobe Acrobat driver. Nothing happens if you click on the hyperlink in the PDF, because Adobe can not interpret weblinks made using the "=hyperlink()" function.

A simple work-around is to mark the whole spread sheet in MS Excel, copy, and in Adobe select "Create PDF from clipbook". Then the hyperlink function works.

2014-05-28 08:13:50


I have a word doc that I am trying to add hyperlinks to go to a specific page on a pdf file. How do I do that with vba macro?

2013-12-04 11:04:52


Excel Office 2010 on Win 7 64 bit
Hyperlink to a specific pdf page:

The above Hyperlink work on office 2003 WinXP with office 2010 it don't work because of: in browser IE 10-11 the link is .......Cent.pdf%20-%20page=851.
20%-20% instead of #
Please could you help me? I don't want to use a macro but a HL in a cell.


2013-10-31 10:54:51

Grant Livet

Thanks again Richard. However, I tried it and it changes the # sign to a %20-%20 in the web browser (Google Chrome) and then says file is not found. If I change the url manually in my browser back to the # sign it works. I also tried this for a pdf residing on my dropbox account, and it pulls up the file, but then does not search it. Does this parameter not work for a https url?

2013-10-30 10:21:50

Richard Chapman

Grant, the HYPERLINK function's open parameters don't work on PDF files stored on your computer but it can work for PDF files that can be found using a URL (http://) file location.

This works for me (using Excel 2010):

In cell A1, enter the URL + the first part of search open parameter, for example:

In cell A2, enter the desired search term(s), for example:

In cell A3, enter the hyperlink function pointing to cells A1 & A2, for example:
=HYPERLINK(A1&A2,"link to PDF with a search open parameter")

Change the search term in cell A2 to open the PDF file highlighting different search term(s).

2013-10-28 10:21:03

Grant Livet

Thanks Richard. Unfortunately, it appears the pdf search does not work, as it seems to ignore my search parameters and continue opening the file to the first page. I'm linking to a local pdf if that makes a difference. Also, is is possible to use a cell reference to search for the value in an adjacent cell instead of having to type the search item in manually. Any ideas would be appreciated. Thank you.

2013-10-25 09:30:03

Richard Chapman

You can put the URL directly in a cell in Excel (no macro required). Click Insert>Hyperlink and put the URL in the Address field: ["PersonsLastName" ]. In the Text to display field, enter whatever text is desired. For example: Click HERE to open the PDF document to see more information about this Person's Name.

NOTE: You will need to find a search term that appears only once in the PDF document for it to open on the specific page. If the "PresonsLastName" appears more than once in the PDF document, it will open on the first page with the search navigation window pre-populated with the various locations the PersonsLastName appears in the document. Spaces in the #search parameter setting means OR for the search conditions.

2013-10-25 09:01:51

Richard Chapman

Adobe defines parameters that allow you to open a PDF document with a command or URL that specifies exactly what to display (a named destination or specific page), and how to display it (using such characteristics as a specific view, scrollbars, bookmarks, annotations, or highlighting). See details at"page=pagenum"

2013-10-24 14:29:45

Grant Livet

Any ideas on how this could be modified to search for the value of the cell in the pdf and go to that page. I.E. the cell has a person's name in it, and by clicking on the cell, it will hyperlink to the pdf and search for the name in the pdf and go to that page?


2013-10-21 14:19:03

Brian Hershman

If you:
(1) need a macro (e.g. to add button to QAT or Ribbon)
(2) want to open only one fixed file
(3) do not need to open a specific page

the following very simple VBA macro works perfectly:

Sub Array_Formula_Help()
ThisWorkbook.FollowHyperlink _
"C:UsersDELLDocumentsExcelAmazing Array Formulas tipsETAF3E.pdf"
End Sub

2013-09-11 13:49:58


Thanks PL.ER.RAJAN, It works, perfect for me :D

2013-07-17 12:49:45

Grant Livet

Any ideas on how this could be modified to search for the value of the cell in the pdf and go to that page. I.E. the cell has a person's name in it, and by clicking on the cell, it will hyperlink to the pdf and search for the name in the pdf and go to that page?


2013-01-25 07:42:40


With some modification it worked as below:

create a function as below:

Function OpenPDFpage(myLink As String, TargetPage As Double)
Set objIE = CreateObject("InternetExplorer.Application")
With objIE
.Navigate myLink & "#page=" & TargetPage
.Visible = True
End With
End Function

In excel enter a formula
in column C

D, Y or N
E, Full path and file name
F, Page no


2013-01-17 11:44:34


I too was trying to link to an internal PDF page and tried the HYPERLINK function. It does not link into an internal page. And I am using v2010.

However, if the Hyperlink dialog box [not the =HYPERLINK() function] is used to create the link, it DOES work.

2013-01-15 17:24:32


Using #page= does not work if the file is stored locally, at least it's not working for me. From what I've read online using #page= only works if you're hyperlinking to a URL

2013-01-15 13:51:26

Richard Chapman

In v2010, using #page=5 as the target in the hyperlink formula works without a macro.


Newest Tips

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.

Links and Sharing