How to open a specific page of PDF document from Excel hyperlink?
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:
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:
5. The PDF should now open on the particular page number you specified, in Internet Explorer. This behavior is demonstrated in the following screenshot:
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:
Best Office Productivity Tools
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.





- 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