[python-win32] Cannot assign values to the Excel Colors property

Niki Spahiev niki at vintech.bg
Tue Aug 24 09:53:41 CEST 2004


Joe Goldthwaite wrote:
> Here's another strange one.  Automating Excel with Python is turning out to
> be a little more difficult than I thought.  I'm trying to set the color
> property of the workbook object. In VB it goes like this;
> 
> Workbook.Colors(1) = &H254A70
> 
> When I try doing this in Python, It complains about the syntax and tells me
> I can't assign a value to a function call.  I also tried this;
> 
> Workbook.Colors[1] = 0xH254A70
> 
> But it tells me "TypeError: object doesn't support item assignment".  I'm
> sure there's a way to do it but the syntax eludes me.  Anyone have any
> ideas?
> 

Maybe workbook.Colors(1, 0x223344) ?

Niki Spahiev


More information about the Python-win32 mailing list