Bug 76104 - VBA: set font color in cell
Summary: VBA: set font color in cell
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
4.0.5.2 release
Hardware: Other Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Macro-VBA
  Show dependency treegraph
 
Reported: 2014-03-13 08:18 UTC by Laube Roman
Modified: 2021-10-19 14:19 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
VBA macro with assignment and font color setting (35.00 KB, application/vnd.ms-excel)
2014-03-13 08:18 UTC, Laube Roman
Details

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

Hello,
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")
    
    
    Sheets("Dest").Select
    Range("D2").Select
    
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...

Sincerely
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 4.4.3.1 - 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 5.2.1.2 - this bug is still present.
Comment 6 Laube Roman 2017-06-29 05:37:02 UTC
version 5.4.0.1 - 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 4.0.1.1 (Build ID: 2c0c17a6e4bee0ee28131ea4bdc47edc700d659)
Comment 12 Andreas Heinisch 2021-10-08 21:00:42 UTC
It seems the bug is gone in:

Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: a4c11b853febd073d310251a4891cdc0ac54e0fa
CPU threads: 6; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: en-US (de_DE); UI: en-US
Calc: CL

However, the font weight error remains.
Comment 13 Andreas Heinisch 2021-10-08 21:10:05 UTC
Tested again. It seems both error are gone in:

Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: a4c11b853febd073d310251a4891cdc0ac54e0fa
CPU threads: 6; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: en-US (de_DE); UI: en-US
Calc: CL