[Solved] Accessing URL in Calc cell

Creating a macro - Writing a Script - Using the API

[Solved] Accessing URL in Calc cell

Postby MikeV » Wed Jul 31, 2013 8:38 pm

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!
Last edited by MikeV on Wed Jul 31, 2013 10:57 pm, edited 1 time in total.
LibreOffice 3.6.2.2 on LinuxMint 14
MikeV
 
Posts: 2
Joined: Wed Jul 31, 2013 8:28 pm

Re: Accessing URL in Calc cell

Postby B Marcelly » Wed Jul 31, 2013 9:01 pm

Upload a sample document as attachment, so that we can see what is in your cell.
Bernard

OpenOffice.org 1.1.5 / Apache OpenOffice 4.0.1 / LibreOffice 4.1.0
MS-Windows 7 Home SP1
B Marcelly
 
Posts: 773
Joined: Mon Oct 08, 2007 1:26 am
Location: France, Paris area

Re: Accessing URL in Calc cell

Postby Villeroy » Wed Jul 31, 2013 9:19 pm

Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 12.04, Apache OpenOffice 4.x
User avatar
Villeroy
Volunteer
 
Posts: 17278
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [SOLVED] Accessing URL in Calc cell

Postby MikeV » Wed Jul 31, 2013 10:58 pm

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.
LibreOffice 3.6.2.2 on LinuxMint 14
MikeV
 
Posts: 2
Joined: Wed Jul 31, 2013 8:28 pm


Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 3 guests