How to Use Excel HYPERLINK Function for Local PDF and JPEG Files
Question details
The user needs to properly configure the HYPERLINK function in Excel to open local PDF and JPEG files without encountering errors.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Creating an inventory, database, or catalog (like family history research) that links to local files directly from a spreadsheet for easy access.
- Observed behavior
- Users encounter errors or security warnings when trying to open files through hyperlinks, especially if wildcards are used or full paths are misconfigured.
Ensure that the local PDF or JPEG files you intend to link haven't been moved, renamed, or deleted, and take note of their exact file paths.
Use Exact Filenames and Absolute Paths
Configure the HYPERLINK formula with the correct absolute path or precise filename to ensure Excel can locate and open the local file.
The most common reason for a broken local hyperlink is using incorrect path formatting or adding wildcards. The HYPERLINK function requires the exact file name and extension.
Click on the cell where you want the hyperlink to appear.
If the target file is in the exact same directory as your workbook, type =HYPERLINK("Test pdf file.pdf").
If the file is in a different location or subfolder, enter the full absolute path. For example: =HYPERLINK("C:\Users\Username\Documents\Test pdf file.pdf").
Press Enter to apply the formula, then click the generated link to verify that the local PDF or JPEG file opens correctly.

Resolve Hyperlink Security Warnings and Recalculate
Address security prompts that prevent Excel from opening linked files and manually refresh the worksheet formulas.
Easily Link and Manage Files with WPS Spreadsheet
WPS Spreadsheet fully supports the HYPERLINK function, allowing you to seamlessly link local PDFs, images, and other files. It provides a familiar interface and comprehensive formula support for organizing data effortlessly.
- 1. Open your workbook: Launch WPS Spreadsheet and open the document where you want to add file links.
- 2. Input the HYPERLINK formula: Select a cell and type =HYPERLINK("Your_File_Path.pdf", "Click to Open").
- 3. Apply the link: Press Enter to generate the clickable hyperlink.
- 4. Access your file: Click the link to securely open your local PDF or JPEG file directly from your WPS spreadsheet.

Frequently Asked Questions
Why does the HYPERLINK function say 'Cannot open the specified file'?
This error usually occurs if the file path is incorrect, the file has been moved or renamed, or if you used wildcards instead of the exact filename. Verify the absolute path and ensure the file exists.
Can I link to files stored in a subfolder using relative paths?
Yes, if the file is within a subfolder of the workbook's current directory, you can type the subfolder name and file name, such as =HYPERLINK("Subfolder\File.pdf"). However, using absolute paths minimizes path resolution errors if the workbook is ever moved.
How do I change the display text of my hyperlink?
You can use the second argument in the HYPERLINK function to add a friendly name. For example: =HYPERLINK("C:\path\file.pdf", "View PDF Document"). This displays 'View PDF Document' in the cell instead of the long file path.
How do I disable hyperlink security warnings in Excel?
Hyperlink warnings can be adjusted in the Trust Center. Go to File > Options > Trust Center > Trust Center Settings, and review the settings under External Content or Macro Settings to adjust the conditions that trigger security prompts.




