Skip to content

Handle hyperlinks better#476

Open
joshuapinter wants to merge 2 commits intoweshatheleopard:masterfrom
cntral:handle_hyperlinks_better
Open

Handle hyperlinks better#476
joshuapinter wants to merge 2 commits intoweshatheleopard:masterfrom
cntral:handle_hyperlinks_better

Conversation

@joshuapinter
Copy link

Prevent adding more hyperlinks than the allowed limit per worksheet in Excel of 65,530.

Exceeding this limit will result in an error when opening up the file, similar to this:

We found a problem with some content in ‘.xlsx'. Do you want us to try to recover as much as we can? If you trust the source of this workbook, click Yes.

Screen Shot 2026-03-04 at 09 33 21

With this change we now prevent the creation of hyperlinks if the limit of 65,530 has been reached.

We will also output a warning to the Rails log but only once. It will show the worksheet name as well as the row and column where it was exceeded.

Fixes #475

If the contents of a cell is a URL and does not include a formula, use the HYPERLINK formula to make it clickable.

This also gets around the 65,530 hyperlinks per Worksheet limit in Excel as these HYPERLINK formulas do not contribute to that count.

Related to #475.

…n Excel of 65,530.

Exceeding this limit will result in an error when opening up the file, similar to this:

> We found a problem with some content in ‘.xlsx'. Do you want us to try to recover as much as we can? If you trust the source of this workbook, click Yes.

With this change we now prevent the creation of hyperlinks if the limit of 65,530 has been reached.

We will also output a warning to the Rails log but only once. It will show the worksheet name as well as the row and column where it was exceeded.

Fixes weshatheleopard#475
…e the `HYPERLINK` formula to make it clickable.

This also gets around the 65,530 hyperlinks per Worksheet limit in Excel as these `HYPERLINK` formulas do not contribute to that count.

Related to weshatheleopard#475.
@joshuapinter
Copy link
Author

joshuapinter commented Mar 4, 2026

We're going to use our fork in Production but I would much prefer to get these merged in upstream so we can use your master branch again so let me know what else needs to be done here.

A few things I can think of are:

  1. Can we use Rails.logger?

  2. Do we need to disable the auto-URL detection or handle it more explicitly?

  3. Add some tests?

Thanks!

Joshua

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

Successfully merging this pull request may close these issues.

Handling the 65,530 hyperlinks limit in Excel.

1 participant