Rubberduck icon indicating copy to clipboard operation
Rubberduck copied to clipboard

unexpected(?) errors when using msoRGBType variables

Open interservices opened this issue 2 years ago • 0 comments

Version 2.5.2.5906 OS: Microsoft Windows NT 10.0.22000.0, x64 Host Product: Microsoft Office x64 Host Version: 16.0.15225.20288 Host Executable: EXCEL.EXE


The following debug-passing code, that I also found on [Stackoverflow],(https://stackoverflow.com/questions/28809779/vba-valid-rgb-value-throws-out-of-range-exception) throws 4 unexpected(?) RD errors (!):

Sub TEST()
    Dim light As MsoRGBType
    light = RGB(195, 214, 155)
    ActiveSheet.Shapes("Arrow1").Line.ForeColor.RGB = light
End Sub
Immagine 2022-06-28 101719

I think that the errors are related to the ambiguity of the RGB values, that are Long and msoRGBType object(?) at the same time. I'm honestly confused about this fact, so I'm not sure about how RubberDuck should behave in this case.

interservices avatar Jun 28 '22 08:06 interservices