Calc Basic format borders colour setting seems wrong

asked 2020-07-03 13:14:15 +0200

jcs94782 gravatar image

updated 2020-08-06 14:16:00 +0200

Alex Kemp gravatar image

I am trying to format some cells in a sheet using Basic macros. I have never tried this level of programming using Calc but I have been doing similar things with Excel since about 1989 (Excel version 2, well before VBA was introduced). I am still learning the object properties/methods to perform the operations I need.

When I try to set the border colour using RGB(255,0,0) I get blue borders. Xray shows the values RGB(0,0,255)

When I use RGB(0,0,255) I get red borders. Xray shows the values RGB(255,0,0). Here is the essence of my code based in anther post.

            Dim basicborder As new
        Dim oborder As Object
        oborder = .TableBorder

        BasicBorder.Color = RGB(255,0,0)
        BasicBorder.InnerLineWidth = 0
        BasicBorder.OuterLineWidth = 40
        BasicBorder.LineDistance = 0

        oBorder.LeftLine = BasicBorder
        oBorder.TopLine = BasicBorder
        oBorder.RightLine = BasicBorder
        oBorder.BottomLine = basicborder

is this a bug? Is there a workaround?

I think that it is related to using the option Option VbaSupport 1 When this is not present it works as expected. /when it is included then the Red and Blue switch over,

LibreOffice Version: (x64) running on Windows 10

edit retag flag offensive close merge delete