Excel Character object through COM
krisztian.sinka at ericsson.com
Fri Aug 26 13:50:43 CEST 2005
Maybe this question is already answared somewhere, but I could not find
I want to modify one of the letters of a text of a Excel cell through
COM; let's say to make it red. The VB reference tells that it can be
.Value = "abcdefg"
.Characters(3, 1).Font.Bold = True
However when I try the similar in Python (I used the 'COM Makepy
utility' of Pythonwin) I got the following (Here 'A' is a class that
wraps the 'com' things):
<win32com.gen_py.Microsoft Excel 9.0 Object Library.Characters instance
Traceback (most recent call last):
File "<interactive input>", line 1, in ?
AttributeError: Characters instance has no __call__ method
So my question is that am I doing something wrong or there is a
different way to modify the color of a charater through COM.
More information about the Python-list