Active Member
December 24, 2020
I have a spreadsheet listing messages and when they exist, the path to their attachment files. These files exist in a sub-directory to the Excel file. I am able to create a formula to "open" the attachments in the Windows environment. So users can just click on the displayed hyperlink and the PDF file opens.
The challenge is that some of my users have Mac laptops and the function fails.
Any thoughts on writing a single formula that will open files in both the Windows and Mac operating systems?
Thanks, and Happy Holidays.
Power Query
Power Pivot
Xtreme Pivot Tables
Excel for Decision Making
Excel for Finance
Excel Analysis Toolpak
Power BI
Excel
Word
Outlook
Excel Expert
Excel Customer Service
PowerPoint
November 8, 2013
Active Member
December 24, 2020
Catalin - Thanks for reaching out.
The formula is the simplest: =Hyperlink(B2,"Click")
The value in B2 is "Subfolder1\subfolder2\subfolder3\filename.jpg".
The Excel file is in a project directory and the target files are in subdirectories within the project directory.
This works great in the Windows world. But the pathing doesn't work in the Mac world.
There are two challenges as I see it:
- first, identify which OS is being used
- second, modify the path to work in the Mac OS
I assume someone has had to make the Hyperlink function work in both environments before. Just not something I have been able to solve.
Thanks.
Power Query
Power Pivot
Xtreme Pivot Tables
Excel for Decision Making
Excel for Finance
Excel Analysis Toolpak
Power BI
Excel
Word
Outlook
Excel Expert
Excel Customer Service
PowerPoint
November 8, 2013
Active Member
December 24, 2020
Ah, very cool. Thanks
Windows: C:\Users\Larry\Slack Test\[Correct_Attachment_Path.xlsx]XXX
Mac: /Users/mhenry/Desktop/[cell_test.xlsx]Sheet1
I can work with this to identify the variations in the folder separator char and then modify the attachment file path.
Thanks! I'll give it a try and post the results.
1 Guest(s)