Page 1 of 1

[Solved] Accessing URL in Calc cell

Posted: Wed Jul 31, 2013 8:38 pm
by MikeV
I'm linking a spreadsheet to a web page which pulls in a hyperlink and pastes it into a cell. The cell displays text on a grey background. If I float the cursor over the text it displays the hyperlink URL. However, even using MRI on the cell object in a Basic macro, I can't find where the URL is stored so that I can access it as a string.

Any pointers or a code snippet would be much appreciated!

Re: Accessing URL in Calc cell

Posted: Wed Jul 31, 2013 9:01 pm
by B Marcelly
Upload a sample document as attachment, so that we can see what is in your cell.

Re: Accessing URL in Calc cell

Posted: Wed Jul 31, 2013 9:19 pm
by Villeroy

Re: [SOLVED] Accessing URL in Calc cell

Posted: Wed Jul 31, 2013 10:58 pm
by MikeV
Thanks Villeroy! That's just what I need.

Note to anyone looking to extract the same URL string: The CELL_URL function linked to by Villeroy does the job and does lots of checking of parameters before delivering the wanted URL string. The key line, which works for me, is:
URLString = CellObject.Textfields.getByIndex(0).URL
I'm still quite new to Macro programming in LibreOffice but I don't think I don't think I'd of found that syntax any other way.