Can anyone see what's wrong with this, can't figure it...
sRGB is the web color......


Dim sRed, sBlue, sGreen as string
Dim iRed, iGreen, iBlue as Integer

sRed = "&H" & Left$(sRGB, 2)
sGreen = "&H" & mid$(sRGB, 3, 2)
sBlue = "&H" & Right$(sRGB, 2)

iRed = CInt((CLng(sRed) And CLng("&HFF0000")) / (CLng("&H00FFFF") + 1))
iGreen = CInt((CLng(sGreen) And CLng("&H00FF00")) / (CLng("&H0000FF") + 1))
iBlue = CInt((CLng(sBlue) And CLng("&H0000FF")) / (CLng("&H000000") + 1))

main.txtColour.BackColor = RGB(iRed, iGreen, iBlue)



thanx for any help

mat