How do I fix the "Cannot open the specified file" error with hyperlinks in Excel for Mac?
0
votes
0
answers
1244
views
Since 2016, Microsoft Excel has run in an [App Sandbox](https://developer.apple.com/documentation/security/app_sandbox) on macOS. This means that a HYPERLINK function which points to a local path, like
The error can be worked around with this method of accessing files from the macOS App Sandbox :
> The operating system implicitly starts security-scoped access on URLs passed from open panels, save panels, or **items dragged to your app’s icon in the Dock** … When the URL your app receives from a standard user interface interaction represents a folder, **the operating system extends your app’s sandbox to items within that folder, and recursively in nested folders**. Some items within the folder could still be inaccessible for other reasons. See “Diagnose other reasons your app can’t access a file,” below.
That is, once the linked file, or its parent directory (in the above example
HYPERLINK("/Users/me/Desktop/example.pdf")
, won't work. Clicking the hyperlink produces this error:

/Users/me/Desktop
), has been dragged from Finder to the Excel icon in the Dock, the link will work. However, this technique is not intuitive and there is no visual feedback to indicate that it has been performed correctly.
I haven't been able to get the technique to work on all Macs. Sometimes, I have to take the additional step of creating a manual link to the parent directory with ⌘K (Insert Link) rather than the HYPERLINK function. Following this link will grant the permission required for function-based links into the specified directory to work. But this is also unintuitive because the open panel won't let you select a directory. You need to choose a file in the directory, then delete the filename from the end of the completed Address.
Is there a simpler and more consistent way to work around the "Cannot open the specified file" error for HYPERLINK functions in Excel for Mac?
Asked by sjy
(404 rep)
Jul 6, 2023, 08:38 AM
Last activity: Jul 6, 2023, 01:11 PM
Last activity: Jul 6, 2023, 01:11 PM