LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


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

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


Hi,

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?

Thanks,
Jim
 
Old 02-26-2014, 06:23 AM   #2
goumba
Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Debian Wheezy (7.0), Jessie (future 8) and Sid (unstable)
Posts: 589
Blog Entries: 4

Rep: Reputation: 82
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:

http://stackoverflow.com/questions/1...in-libreoffice

replace:
Code:
Doc = ThisComponent
Sheet = Doc.Sheets(1)

Cell = Sheet.getCellByPosition(0, 0)
with

Code:
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
CollieJim
Member
 
Registered: Mar 2005
Distribution: Gentoo, Kubuntu
Posts: 477

Original Poster
Rep: Reputation: 19
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.
 
  


Reply


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


All times are GMT -5. The time now is 08:38 AM.

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