Skip to main content

Kutools for Office — One Suite. Five Tools. Get More Done.

How to open a specific page of PDF document from Excel hyperlink?

Author Xiaoyang Last modified

When inserting a hyperlink to a PDF file in Excel, clicking the link typically opens the document at its first page by default. However, there are situations in which you may want to jump directly to a specific page within the PDF, such as referencing a particular section or facilitating quick access for readers or colleagues. Unfortunately, Excel's built-in hyperlink feature does not natively support navigating to a specific PDF page. This article presents practical methods to achieve this requirement, improving workflow efficiency when dealing with multi-page PDF documents.

Open a specific page of PDF document from Excel hyperlink with VBA code


Open a specific page of PDF document from Excel hyperlink with VBA code

This VBA method enables Excel to launch a PDF file at a specified page by constructing the appropriate file path and calling the file through Internet Explorer. Consider using this solution in scenarios where you frequently reference different sections within large PDF documents, such as technical manuals, contracts, or reports. However, note that this approach relies on Internet Explorer, which may not be the default browser on all systems.

Please follow these steps to complete the task:

1. In the cell where you want to create the hyperlink, enter the full file path, document name, and target page number using the following format:

file:///C:\Users\DT168\Desktop\PDF file\Excel add-ins.pdf#page=10

This format tells the system to open the local file and navigate directly to page10 of the PDF. You should replace the path, file name, and page number with your actual file details and desired page. For example, if your PDF file is located elsewhere or you want to open page 7, adjust the numbers accordingly. Here is a screenshot for reference:

A screenshot showing how to enter a PDF file path with specific page in Excel cell

Note: If your file path contains spaces, ensure you use the correct syntax (three forward slashes after 'file:', and avoid unnecessary spaces). Be sure your PDF file is accessible at the specified location.

2. With the hyperlink information ready, press ALT + F11 to open the Microsoft Visual Basic for Applications window. This opens the VBA editor, where you can add and run custom code for automating tasks in Excel.

3. In the VBA window, click Insert > Module. In the new module window, copy and paste the following code:

Sub linkpdfpage()
Worksheets("Sheet1").Activate
Shell ("C:\Program Files\Internet Explorer\iexplore.exe " + ActiveCell.Value)
End Sub

Make sure you paste the code exactly as provided. If you are prompted with a security warning, adjust your macro settings to allow code execution. Always review VBA code before running to ensure safety, especially if received from untrusted sources.

4. Close the VBA editor. Then, in the Excel worksheet, select the cell that contains the file path and page number you entered earlier. Return to the VBA editor and click the Run button (usually represented as a green triangle. The code will execute, opening the specified PDF file at the desired page, as shown below:

A screenshot showing the VBA editor with the pasted module code

5. The PDF should now open on the particular page number you specified, in Internet Explorer. This behavior is demonstrated in the following screenshot:

A screenshot of a PDF opened to a specific page in Internet Explorer

Tips and Precautions:

  • This VBA approach relies on Internet Explorer, which is deprecated in recent Windows versions and could behave inconsistently or may not be available in the future. If you encounter an error or the file does not open, check your browser settings and try running Excel and Internet Explorer as an administrator.
  • If you wish to use another browser, additional programming is required and the above method may not work directly.
  • Always ensure your macro settings allow you to run VBA code (File > Options > Trust Center > Macro Settings).
  • If your hyperlink path is invalid (e.g., file moved or renamed), the code may return an error or open a blank page. Double-check your file location and spelling.
  • Consider making a backup copy of your Excel file before running unfamiliar macros.

Demo:

 
Kutools for Excel: Over 300 handy tools at your fingertips! Enjoy permanently free AI features! Download Now!

Best Office Productivity Tools

šŸ¤– Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions…
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!

All Kutools add-ins. One installer

Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.

Excel Word Outlook Tabs PowerPoint
  • All-in-one suite — Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
  • One installer, one license — set up in minutes (MSI-ready)
  • Works better together — streamlined productivity across Office apps
  • 30-day full-featured trial — no registration, no credit card
  • Best value — save vs buying individual add-in