Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 02-25-2014, 11:32 PM   #1
Registered: Mar 2005
Distribution: Gentoo, Kubuntu
Posts: 535

Rep: Reputation: 28
Libreoffice function to insert colour in a cell


I have a spreadsheet with a large number of RGB triplets.
I want to write a function that will take 3 numbers and change the colour of the cell to that RGB value.

Is it possible, and if so, where do I look to get started?

Old 02-26-2014, 06:23 AM   #2
Senior Member
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Debian, Arch
Posts: 1,163
Blog Entries: 7

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
I did this using a LibreOffice Basic script a few years back. Unfortunately I have lost that script, but this is similar to what I did:

Doc = ThisComponent
Sheet = Doc.Sheets(1)

Cell = Sheet.getCellByPosition(0, 0)

Doc = ThisComponent
Cell = Doc.getCurrentSelection
Whatever name you give the function, you'll call it as a formula. So, if you call the function ChangeRGB", the formula you would enter is "=CHANGERGB()"

Hope this helps you, or at least gets you a start.

Last edited by goumba; 02-26-2014 at 06:25 AM.
Old 02-26-2014, 09:48 AM   #3
Registered: Mar 2005
Distribution: Gentoo, Kubuntu
Posts: 535

Original Poster
Rep: Reputation: 28
Thanks, but when I try to get help on Basic, the page says it is no longer used, and that the API has to be used now which is a lot more complicated.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
protect/lock a cell in libreoffice calc knobby67 Linux - Software 5 01-11-2015 04:45 AM
want to insert a flv file into libreoffice writer document rmknox Linux - Software 2 12-25-2012 09:09 PM
LibreOffice Writer: How to color single cell with multiple colors ghantauke Linux - General 1 09-21-2012 08:56 PM
A macro for solve insert/delete merged cell/column kstan Linux - General 0 11-02-2008 11:01 PM
Abiword --- Can't insert picture in table cell rickh Linux - Software 2 03-07-2006 12:53 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:02 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration