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

Is it possible to add a hyperlink to an image? #185

Closed
Eugenijus opened this issue Feb 2, 2018 · 8 comments
Closed

Is it possible to add a hyperlink to an image? #185

Eugenijus opened this issue Feb 2, 2018 · 8 comments

Comments

@Eugenijus
Copy link

I think this is FEATURE REQUEST.

Description

I am adding images to spreadsheet cell and want to add a hyperlink on that image.
I couldn't find a way with this library, so I add hyperlink to a cell. However, some cells have two images or more, hence adding hyperlink to a cell doesn't always produce a needed result.

Is it even possible to add a hyperlink to an image by code? I know it's possible from Excel and Calc.

Thanks for creating this library, I think that's very awesome.

@xuri xuri added enhancement New feature or request in progress Working in progress labels Feb 3, 2018
xuri added a commit that referenced this issue Feb 3, 2018
…, relate issue #185;

- go test and document has been updated.
@xuri
Copy link
Member

xuri commented Feb 3, 2018

Thanks for your issue. I have to init add a hyperlink to an image support for the function AddPicture().

@xuri xuri removed enhancement New feature or request in progress Working in progress labels Feb 3, 2018
@Eugenijus
Copy link
Author

Eugenijus commented Feb 5, 2018

Thank you. However, when I create a simple spreadsheet or a spreadsheet with image + hyperlink, there is an Excel 2016 error when opening that spreadsheet:

Excel was able to open the file by repairing or removing the unreadable content.
Repaired Records: Worksheet properties from /xl/workbook.xml part (Workbook)

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><logFileName>error139200_01.xml</logFileName><summary>Errors were detected in file 'C:\...\Workbook2.xlsx'</summary><repairedRecords><repairedRecord>Repaired Records: Worksheet properties from /xl/workbook.xml part (Workbook)</repairedRecord></repairedRecords></recoveryLog>

There is also an extra Sheet being created "Recovered_Sheet2"
Workbook2.xlsx
error186720_03.xml.txt

@xuri
Copy link
Member

xuri commented Feb 6, 2018

Please provide the file attachment if you can.

@Eugenijus
Copy link
Author

Eugenijus commented Feb 6, 2018

please see attached.
Workbook2.xlsx
error186720_03.xml.txt

@xuri
Copy link
Member

xuri commented Feb 6, 2018

Could you provide the origin file and code?

@Eugenijus
Copy link
Author

Here: excel2.zip

@xuri
Copy link
Member

xuri commented Feb 6, 2018

Oh, when calling the NewFile() function will automatically create a worksheet named Sheet1, so we needn't call the function NewSheet() when only one worksheet in the workbook.

@Eugenijus
Copy link
Author

It's working without error now. Thank you! :)

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

2 participants