Download it now!
Bug 76104 - VBA: set font color in cell
Summary: VBA: set font color in cell
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
(earliest affected) release
Hardware: Other Linux (All)
: medium normal
Assignee: Not Assigned
Depends on:
Blocks: Macro-VBA
  Show dependency treegraph
Reported: 2014-03-13 08:18 UTC by Laube Roman
Modified: 2020-05-21 14:52 UTC (History)
0 users

See Also:
Crash report or crash signature:

VBA macro with assignment and font color setting (35.00 KB, application/
2014-03-13 08:18 UTC, Laube Roman

Note You need to log in before you can comment on or make changes to this bug.
Description Laube Roman 2014-03-13 08:18:08 UTC
Created attachment 95695 [details]
VBA macro with assignment and font color setting

in attached XLS file there is simple VBA macro which (after pressing "CZ" button) copies cells from list "Src" to list "Dest" and sets font color of 2 cells to white:

Sub copy_to_CZ1()
    Sheets("Dest").Range("A2") = Sheets("Src").Range("A3")
    Sheets("Dest").Range("B2") = Sheets("Src").Range("B3")
    Sheets("Dest").Range("C2") = Sheets("Src").Range("C3")
    Sheets("Dest").Range("B2:C2").Font.Color = RGB(255, 255, 255)
    Sheets("Dest").Range("D2") = Sheets("Src").Range("D3")
    Sheets("Dest").Range("E2") = Sheets("Src").Range("E3")
End Sub

But after pressing "CZ" button last two assignments aren't executed (but Sheets("Dest").Select and Range("D2").Select is executed). If you delete row with font color setting. All assignments are executed properly.

I cannot confirm this bug in other LibreOffice versions but it was working in OpenOffice 3.2.1...

Laube Roman
Comment 1 Julien Nabet 2014-03-14 22:28:06 UTC
On pc Debian x86-64 with master sources updated today, I can reproduce this.
Comment 2 Joel Madero 2015-05-02 15:41:32 UTC Comment hidden (obsolete)
Comment 3 Laube Roman 2015-05-03 18:39:41 UTC
version - this bug is still present.
Comment 4 QA Administrators 2016-09-20 09:37:23 UTC Comment hidden (obsolete)
Comment 5 Laube Roman 2016-09-21 05:51:07 UTC
version - this bug is still present.
Comment 6 Laube Roman 2017-06-29 05:37:02 UTC
version - this bug is still present.
Comment 7 Julien Nabet 2017-07-02 07:19:07 UTC
Can't help here.
Comment 8 QA Administrators 2018-07-03 02:38:43 UTC Comment hidden (obsolete)
Comment 9 Laube Roman 2018-07-03 20:06:25 UTC
Version 6.0.5 - bug is still present.
Comment 10 Andreas Heinisch 2020-02-17 09:27:23 UTC
Strange behaviour of LO. Changing the function for test purposes to the following snippet, the color and "D3" statements are executed, whereas the last statement is not. 

Sub copy_to_CZ1()
    Sheets("Dest").Range("B2:C2").Font.Color = RGB(255, 255, 255)
    ' Gets executed
    Sheets("Dest").Range("D2") = "D3"
    ' Doesn't get executed properly
    Sheets("Dest").Range("E2") = Sheets("Src").Range("E3")
End Sub

Same behaviour if you change the font weights, i.e.,     Sheets("Src").Range("B2:C2").Font.Bold = True. So it does not only depend on color settings.
Comment 11 Andreas Heinisch 2020-02-19 18:00:43 UTC
Version not affected of the bug:
Version (Build ID: 2c0c17a6e4bee0ee28131ea4bdc47edc700d659)