[python-win32] Excel Characters object

Tim Roberts timr at probo.com
Tue May 27 19:19:33 CEST 2014


Niemann, Hartmut wrote:
>  
>
> I want to create an Excel file through the python COM interface.
>
> I can open the file, fill the cells, save the file.
>
>  
>
> Now I want to color single characters in the cell content.
>
>  
>
> In VBA ( see
>
> http://stackoverflow.com/questions/7618121/excel-vba-change-color-of-certain-characters-in-a-cell)
>
> I would do
>
> Cell.Characters(i, 1).Font.Color = vbRed
>
>  
>
> How does that translate to Python?
>
> mycell.Characters[x:y] does not work, nor anything else I tried.
>

That's interesting.  Theoretically, the Characters object should have a
__call__ method, so you could call it exactly like in VB:
    Cell.Characters(i,1)
but I don't see that in the generated COM interface.

That's going to be an ugly one to chase down.

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20140527/d1bc5cb6/attachment-0001.html>


More information about the python-win32 mailing list