[quote user="Nenad Poljcic"]How do I convert RGB values to internal microstation rgb index ( 0 to 254 ) [/quote]
From VBA help...
InternalColorFromRGBColor
This retrieves a number that contains 2 indices. The least significant byte is an index of the closest matching color in the color table. The remainder of the value is an index into the model's table of RGB values.
A program can use a value returned from InternalColorFromRGBColor to set an element's color
There's an example in help as well.
What's possibly confusing your analysis is the structure of that Long. As well as the RGB value there's an 8-bit index into MicroStation's colour table. In other words, all 32-bits of the Long are used.