[pywin32-bugs] [ pywin32-Bugs-1097387 ] Characters property does not have __call__ method
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: SourceForge.net <no...@so...> - 2005-01-06 18:50:20
|
Bugs item #1097387, was opened at 2005-01-06 13:50 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1097387&group_id=78018 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Daniel B. Habersat (dhabersa) Assigned to: Nobody/Anonymous (nobody) Summary: Characters property does not have __call__ method Initial Comment: The Characters property/method is supposed to allow an application to modify the contents (in whole or in partial) of a cell, text box, etc. According to the Microsoft Excel Object Model, Characters has two optional arguments, one to specify the starting position and a second to specify the number of characters (default is for the whole set). When I try to call Characters of an object such as an AxisTitle or Cell, python fails with an error like so: <-- Traceback (most recent call last): File "__init__.py", line 546, in ? y2axis.AxisTitle.Characters(2,2).Font.Subscript = True AttributeError: Characters instance has no __call__ method --> The way that a call like this should work can be easily implemented within Excel's Visual Basic Editor with an open sheet named "Sheet1": <-- Function demonstration() Sheet1.Cells(1,1).Value = "test phrase" Sheet1.Cells(1,1).Characters(1,4).Font.Bold = True End Function --> This script places the value "test phrase" into the first cell on Sheet1, and then makes only the "test" part bold. I have made a python script which attempts to do the same thing as an example but fails on the call to Characters. Software versions: Python 2.3.2 win32com build 203 Microsoft Excel 2002 (10.4302.4219) SP-2 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1097387&group_id=78018 |