LO Calc Macro change cell background color issue. [closed]

asked 2015-10-15 12:29:26 +0100

Dycius gravatar image

Hi all,

I have a really simple macro that I want to change the background color of a cell with. I will eventually have a column of cells with a hex value of a color, then in the next column the cells will have this macro to change the background color. I have it really simple right now to test it, but all it does is change the cell text to invisible and doesn't change the background color at all. I've searched the internet and found you are supposed to use CellBackColor. This is the test macro:

Function BGCOLOR(colorhex As String)
    ThisComponent.CurrentSelection.CellBackColor = clng("&H" & colorhex)
End Function

and this is how I am calling it:


Is there a mistake in this that I just cannot see?

Thanks, Jon

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Alex Kemp
close date 2020-08-26 17:00:28.756485


what do expect - this color is close to black with hexvalue 000000

karolus gravatar imagekarolus ( 2015-10-15 12:47:20 +0100 )edit