python - Setting a cell's fill RGB color with pywin32 in excel? -


I am avoiding using any other module.

What am I trying to do with the color of the cell in aqua, using pywin32 libary. So far, I have found out how to get cell color:

  print xl.ActiveSheet.Cells (line, column) .interior.color   

and You can set it by assigning it equally:

  xl.ActiveSheet.Cells (line, column) .interior.color = 0 #black   < P>  My question is how to set the color of the cell in RGB?   

I am called a color changer for OLE, but I do not know how system .drawing is because it looks like a .NET < / Code> is the object.

internal.color is expected of a hex value if you want to specify in the RGB form below the code Can be used

  def rgb_to_hex (rgb): strValue = '% 02x% 02x% 02x'% rgb iValue = int (strValue, 16) iValue xl.ActiveSheet.Cells (line , Column) back Interval .color = rgb_to_hex ((255,255,0,0))    

Comments

Popular posts from this blog

java - NullPointerException for a 2d Array -

python - Assemble mpeg file unable to play in mediaplayer -

c# - NameSpace Manager or XsltContent to parse aspx page -