[Solved] Function SUBSTITUTE not working

Discuss the spreadsheet application
Post Reply
philipps
Posts: 3
Joined: Wed Nov 14, 2018 7:48 pm

[Solved] Function SUBSTITUTE not working

Post by philipps »

Dear All,

trying the SUBSTITUTE function gives me an error, although i got it from the docu (https://wiki.openoffice.org/wiki/Docume ... E_function)

The error messages says: "Your placement of parentheses is wrong"

As you can see I use OpenOffice calc 4.1.5. on MAC.

Thanks in advance for any help
Attachments
Bildschirmfoto 2018-11-14 um 18.54.49.png
Last edited by philipps on Wed Nov 14, 2018 11:14 pm, edited 1 time in total.
OpenOffice 4.1.5.
FJCC
Moderator
Posts: 9275
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Function SUBSTITUTE not working

Post by FJCC »

SUBSTITUTE is a spreadsheet function, not an OpenOffice Basic function. Can you explain more about what you are trying to do?
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
philipps
Posts: 3
Joined: Wed Nov 14, 2018 7:48 pm

Re: Function SUBSTITUTE not working

Post by philipps »

Oh, that's too bad.

I wanna replace all the spaces inside a string. Whilst Trim () removes spaces vom beginning and end, i need to remove all the spaces inside the string:

"how are you" -> "howareyou"

any basic function for that?
OpenOffice 4.1.5.
philipps
Posts: 3
Joined: Wed Nov 14, 2018 7:48 pm

Re: Function SUBSTITUTE not working

Post by philipps »

The function is called REPLACE with same arguements in Basic. Sorry for bothering.
OpenOffice 4.1.5.
User avatar
Zizi64
Volunteer
Posts: 11360
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: [Solved]Function SUBSTITUTE not working

Post by Zizi64 »

Otherwise you can call the Cell functions from the Basic:

Code: Select all

Function MySubstitute2(sText1 as string, sText2 as string, sText3 as string) as string

	FuncAcc = createunoservice("com.sun.star.sheet.FunctionAccess")
	sResult=FuncAcc.callFunction("SUBSTITUTE", array(sText1,sText2,sText3))
	
 MySubstitute2 = sResult
End function
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Post Reply