Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Excel hyperlinked to .pdf file opens PDF in Adobe Acrobat despite having set SumatraPDF.exe as default program #4764

Open
dtexwang opened this issue Jan 12, 2025 · 0 comments

Comments

@dtexwang
Copy link

SumatraPDF version

  • Version 3.6.16779 64-bit Pre-release on Windows 10
  • True for prior stable versions too

Describe the bug
Excel will not open a hyperlinked PDF file in the correct application (SumatraPDF) once Adobe Acrobat is installed if SumatraPDF does not have a CLSID that can be assigned to HKEY_CURRENT_USER\Software\Classes\MIME\Database\Content Type\application/pdf.

To Reproduce
Steps to reproduce the behavior:

  1. Set Default App > application/pdf > .pdf (Figure 1).
  2. Create hyperlink to a PDF file (e.g., =HYPERLINK("Letter.pdf")) in an Excel cell (Figure 2).
  3. Click on hyperlink in Excel. The PDF file opens in Adobe instead of Sumatra (Figure 3).

Expected behavior
Clicking on the hyperlink to the PDF file in Excel should open the file in my default app, SumatraPDF. However, it opens in Adobe, even if the default app is set to SumatraPDF and all other ways of opening the file open it correctly in Sumatra (Figure 4).

This results from Excel's Web links being MIME types, not "Application defaults". MIME links are in the Windows Registry as: HKEY_CURRENT_USER\Software\Classes\MIME\Database\Content Type\application/pdf
Reference: https://www.reddit.com/r/excel/comments/1fgpn7e/excel_hyperlinked_to_pdf_file_opens_adobe_reader/

However, I am unable to set application/pdf to SumatraPDF.exe (Figure 5) because this appears to require that the referenced application have a CLSID (e.g., Figure 6). I am unable to locate a CLSID under HKEY_CLASSES_ROOT\CLSID\... for Sumatra.

Additional context/proposed solution
Solution could be to make a CLSID under HKEY_CLASSES_ROOT\CLSID\{xxxxx .... for SumatraPDF (Figure 7).

Screenshots

Figure 1. SumatraPDF is set as Default App for .pdf files
image

Figure 2. HYPERLINK function in Excel to link to a .PDF file
image

Figure 3. PDF file linked in Excel opens in Adobe Acrobat instead of SumatraPDF
image

Figure 4. This happens despite SumatraPDF being set as the default program and opens the file correctly in Explorer, Edge, etc.
image

Figure 5. HKEY_CURRENT_USER\Software\Classes\MIME\Database\Content Type\application/pdf does not have a CLSID set (unlike Figure 6)
image

Figure 6. Compare to: (see how this has CLSID)
image

Figure 7. CLSIDs under HKEY_CLASSES_ROOT\CLSID\ in regedit.exe
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant