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

Range.hyperlink fails if the Hyperlink has been set with the cell formula #132

Closed
fzumstein opened this issue Jan 10, 2015 · 3 comments
Closed
Labels
Milestone

Comments

@fzumstein
Copy link
Member

Range.hyperlink only works if the link has been set programmatically, not when it it set with the =HYPERLINK() formula.

@fzumstein fzumstein added the bug label Jan 10, 2015
@fzumstein fzumstein added this to the v0.3.1 milestone Jan 10, 2015
@fzumstein
Copy link
Member Author

Something like this will work:

import re
formula = Range('A1').formula
hyperlink = re.compile(ur'\"(.+?)\"').search(formula).group(1)  # or re.findall(r'\"(.+?)\"', formula)[0]

@fzumstein fzumstein modified the milestones: v0.3.1, v0.3.2, v0.3.3 Jan 16, 2015
@Bernouilly
Copy link

Bernouilly commented May 31, 2017

This solution raise in new problem, though:
a formula containing a string (from a MATCH or a LOOKUP) will be interpreted as an hyperlink
The re should test the presence of 'HYPERLINK' instead.

EDIT: by the way, the workaround I used was to use the self.impl.hyperlink like:
sheet.range(cell_coord).impl.hyperlink

@fzumstein
Copy link
Member Author

matching hyperlink is an issue because of non-english versions. How is your cell formula or could you attach a small example please, thanks.

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

No branches or pull requests

2 participants