You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openoffice.apache.org by David Stuhr <da...@verizon.net.INVALID> on 2021/05/26 20:58:05 UTC

Can User Functions Be Created In OpenOffice Spreadsheet

Hello,

I have an OpenOffice Calc (spreadsheet) that has over a thousand 
Hyperlinks and I would like to create a user defined function which 
would extract the URL from the Hyperlink and put it in a separate cell.

I found an Excel example on the web which I pasted in below.

Function GetURL(rng As Range) As String
     On Error Resume Next
     GetURL = rng.Hyperlinks(1).Address
End Function

Can this be done in OpenOffice Calc? I have looked for documentation but 
I probably using the incorrect terms so I have not found any 
information. I use both the Windows and Mac versions of Open office. 
Thank you. I enjoy reading the support you provide to users and I have 
learned several things. dds


Re: Can User Functions Be Created In OpenOffice Spreadsheet

Posted by Andrew Pitonyak <an...@pitonyak.org>.
you can write user defined functions it's very easy. The easiest way is to pass the value of a cell and then just return a string or whatever you want. I don't remember what happens when you pass the cell value like that if you are parsing out text and pulling out a URL property it's probably easier if you have the address so you can actually pull the cell and then look at properties but I'm hanging out in the car far from any of my documentation so that would be tricky to find.

The easiest way to do that is to make sure that the user-defined macro that you created is embedded in the document in question and then put it in the standard library so that it's automatically loaded. They're better ways to get around that but that's absolutely the easiest way to do it.

If you really can't figure it out let me know.

⁣Get BlueMail for Android ​

On May 26, 2021, 4:58 PM, at 4:58 PM, David Stuhr <da...@verizon.net.invalid> wrote:
>Hello,
>
>I have an OpenOffice Calc (spreadsheet) that has over a thousand 
>Hyperlinks and I would like to create a user defined function which 
>would extract the URL from the Hyperlink and put it in a separate cell.
>
>I found an Excel example on the web which I pasted in below.
>
>Function GetURL(rng As Range) As String
>     On Error Resume Next
>     GetURL = rng.Hyperlinks(1).Address
>End Function
>
>Can this be done in OpenOffice Calc? I have looked for documentation
>but 
>I probably using the incorrect terms so I have not found any 
>information. I use both the Windows and Mac versions of Open office. 
>Thank you. I enjoy reading the support you provide to users and I have 
>learned several things. dds

Re: Can User Functions Be Created In OpenOffice Spreadsheet

Posted by Julian Thomas <jt...@icloud.com.INVALID>.

> On May 26, 2021, at 16:58, David Stuhr <da...@verizon.net.INVALID> wrote:
> 
> I have an OpenOffice Calc (spreadsheet) that has over a thousand Hyperlinks and I would like to create a user defined function which would extract the URL from the Hyperlink and put it in a separate cell.

If all else fails this should work:

- export as CSV [or TSV]
- write a program to find the URLs and rebuild the CSV with the new cell
- open in calc and save as .calc

 —
jt - jt@jt-mj.net

Do unto those downstream as you would have those upstream do unto you. - Wendell Berry 






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@openoffice.apache.org
For additional commands, e-mail: users-help@openoffice.apache.org