[Solved] UNICODE() works in Calc cell, but not in macro

Creating a macro - Writing a Script - Using the API

[Solved] UNICODE() works in Calc cell, but not in macro

Postby alf50 » Fri May 01, 2020 10:01 pm

Why does The "= UNICODE(cell id)" command work in a Calc Cell, but not in a calc Macro?
I get the error "Sub-procedure or function procedure not defined.
Do I have to access a OO Library to get it to work in my Calc Macro?
Last edited by MrProgrammer on Fri May 08, 2020 7:02 pm, edited 3 times in total.
Reason: Moved topic from Calc forum to Macros and UNO API; Tagged ✓ [Solved]
OpenOffice 4.1.5 on Mac El Capitan(10.11.6) and MS Windows10
alf50
 
Posts: 102
Joined: Sun Jun 13, 2010 2:55 pm

Re: Why does UNICODE work in a Calc Cell, but not in Macro?

Postby Zizi64 » Sat May 02, 2020 5:53 am

Why does The "= UNICODE(cell id)" command work in a Calc Cell, but not in a calc Macro?


How you tryed to use it?

Please upload your sample code embedded in a sample .ods file.


You can call the Calc Cell Functions from a macro code, but you must pass the parameters as an Array. You must use the Functionaccess feature of the API.
viewtopic.php?f=20&t=636
viewtopic.php?f=25&t=9947
https://forum-test.openoffice.org/en/fo ... 74&t=72284
Tibor Kovacs, Hungary; LO6.1.6, 6.2.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-6.4.5;AOO4.1.7
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.
User avatar
Zizi64
Volunteer
 
Posts: 9427
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Why does UNICODE work in a Calc Cell, but not in Macro?

Postby Zizi64 » Sat May 02, 2020 6:00 am

And there are StarBasic commands for the unicode characters (LibreOffice HELP):

https://help.libreoffice.org/4.4/Calc/Text_Functions

You must pass an integer to the function UNICHAR(), and you must pass an unicode character to the function UNICODE() - but not a cell reference, not a cell object.
Tibor Kovacs, Hungary; LO6.1.6, 6.2.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-6.4.5;AOO4.1.7
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.
User avatar
Zizi64
Volunteer
 
Posts: 9427
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary


Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 7 guests