Android Question Excel Hyperlink

marcick

Well-Known Member
Licensed User
Longtime User
Hi guys,
anybody knows how can I add a HyperLink when writing to a cell with Excel library ?
 

marcick

Well-Known Member
Licensed User
Longtime User
This is the string I should write in the cell to obtain what I need, but writing it with Excel Library then I have the plain text as result and not the HyperLink.

B4X:
=HIPERLINK("www.google,it", "Google")
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
=HIPERLINK
Are you sure it is the correct command? Shouldn´t it be HYPERLINK(url, [optional name]) ?

Away from that you should NOT use comma in a URL. Use DOT. Also you need to enter a complete http URL!
B4X:
HYPERLINK("http://www.google.it", "Google")
works.
 
Last edited:
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
Sorry for the mistake in the post, yes, HYPERLINK.
But in the genereted Excel I read the string as plain text. If then (in Excel) I copy that string and paste in another cell, the result is correct, eg an Hyperlink.
 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
It should work with excel library too. you need to add the correct formula to the cell.

No, it doesn't .....
in the genereted Excel I read the string as plain text. If then (in Excel) I copy that string and paste in another cell, the result is correct, eg an Hyperlink.
 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
B4X:
            Dim cell As WritableCell
            cell.InitializeText(6, Index,"=COLLEG.IPERTESTUALE(" & Chr(34) & "www.google.it" & Chr(34) & "," & Chr(34) & "Google" & Chr(34) & ")")
            cell.SetCellFormat(cf)
            Sheet1.AddCell(cell)

(italian version of Excel)

And this is the result. In cell H2 I have copied the contents of cell G2 and it has been translated to HyperLink

1616757043699.png
 
Upvote 0

angel_

Well-Known Member
Licensed User
Longtime User
Try this:

B4X:
cell.InitializeFormula(6, 1, "=HYPERLINK(""http://www.google.it"",""Google"")")
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
I don't know ....
YOU are adding this as a fomula in your Code!
B4X:
 Dim cell As WritableCell
            cell.InitializeText(6, Index,"=COLLEG.IPERTESTUALE(" & Chr(34) & "www.google.it" & Chr(34) & "," & Chr(34) & "Google" & Chr(34) & ")")
            cell.SetCellFormat(cf)
            Sheet1.AddCell(cell)

Add the correct formula!!! DO NOT USE GOOGLE TRANSLATE TO TRANSLATE CODE

I´m out here.
 
Upvote 0
Top