[GH-ISSUE #267] internal hyperlink location not set #212

Closed
opened 2026-05-05 11:56:18 -06:00 by gitea-mirror · 4 comments
Owner

Originally created by @mewalig on GitHub (Jan 16, 2020).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/267

Originally assigned to: @jmcnamara on GitHub.

calling worksheet_write_url() with an internal target such as:
"internal:#'my target worksheet'!A1"

the link location was being set to an empty string, so the output xlsx cell contained a link that appeared to be clickable, but upon click, did not do anything. This issue did not seem to exist a few months ago, so may have been introduced from a recent change.

Making the following change to src/worksheet.c around line 4888 seemed to fix the problem, though I'm not sure this doesn't cause other problems:

if(found_string != url_copy) /* added this line. maybe should be: if(link_type == HYPERLINK_EXTERNAL)? */
    *found_string = '\0';
Originally created by @mewalig on GitHub (Jan 16, 2020). Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/267 Originally assigned to: @jmcnamara on GitHub. calling ```worksheet_write_url()``` with an internal target such as: "internal:#'my target worksheet'!A1" the link location was being set to an empty string, so the output xlsx cell contained a link that appeared to be clickable, but upon click, did not do anything. This issue did not seem to exist a few months ago, so may have been introduced from a recent change. Making the following change to src/worksheet.c around line 4888 seemed to fix the problem, though I'm not sure this doesn't cause other problems: if(found_string != url_copy) /* added this line. maybe should be: if(link_type == HYPERLINK_EXTERNAL)? */ *found_string = '\0';
gitea-mirror 2026-05-05 11:56:18 -06:00
Author
Owner

@jmcnamara commented on GitHub (Jan 16, 2020):

Thanks. Just to be clear can you add a small complete C program that demonstrates the issue and I'll look at it.

<!-- gh-comment-id:575110233 --> @jmcnamara commented on GitHub (Jan 16, 2020): Thanks. Just to be clear can you add a small complete C program that demonstrates the issue and I'll look at it.
Author
Owner

@jmcnamara commented on GitHub (Jan 16, 2020):

Also is it valid to have # at the start of the link like that? I don't think it is. If it worked before it probably shouldn't have.

<!-- gh-comment-id:575116389 --> @jmcnamara commented on GitHub (Jan 16, 2020): Also is it valid to have # at the start of the link like that? I don't think it is. If it worked before it probably shouldn't have.
Author
Owner

@mewalig commented on GitHub (Jan 17, 2020):

Oh, should it instead be called as follows?
worksheet_write_url(ws, "internal:'my target worksheet'!A1")

? If so we'll just do that. Not sure why we thought we needed the "#" before

Would it be possible to add an example (or a reference thereto) of an internal hyperlink to https://libxlsxwriter.github.io/hyperlinks_8c-example.html?

<!-- gh-comment-id:575590547 --> @mewalig commented on GitHub (Jan 17, 2020): Oh, should it instead be called as follows? worksheet_write_url(ws, "internal:'my target worksheet'!A1") ? If so we'll just do that. Not sure why we thought we needed the "#" before Would it be possible to add an example (or a reference thereto) of an internal hyperlink to https://libxlsxwriter.github.io/hyperlinks_8c-example.html?
Author
Owner

@jmcnamara commented on GitHub (Jan 17, 2020):

Oh, should it instead be called as follows?

Yes. That is right.

Would it be possible to add an example (or a reference thereto) of an internal hyperlink to

I'm not sure it make sense there but there are several examples in the API docs:

https://libxlsxwriter.github.io/worksheet_8h.html#a9b2ac96ee23574a432f5703eedcaf9a1

<!-- gh-comment-id:575592350 --> @jmcnamara commented on GitHub (Jan 17, 2020): > Oh, should it instead be called as follows? Yes. That is right. > Would it be possible to add an example (or a reference thereto) of an internal hyperlink to I'm not sure it make sense there but there are several examples in the API docs: https://libxlsxwriter.github.io/worksheet_8h.html#a9b2ac96ee23574a432f5703eedcaf9a1
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/libxlsxwriter#212
No description provided.