[python-win32] resizing excel comment fields

Karl Fast karl.fast at pobox.com
Tue Nov 11 12:19:38 EST 2003

I'm trying to resize comments for individual cells in an excel
worksheet (loong story). Can't make it work.

I can do things like this:

  obj.Cells(row, col).ClearComments()
  obj.Cells(row, col).AddComment()
  obj.Cells(row, col).Comment.Text(Text = 'blah')
What I need to do is, for a given cell (just one, not a range),

  - create a comment (clear comment if it already exists)
  - add some text
  - resize comment box (make it several times wider than the default
    since my comments are very long strings).
I'm new to COM and the docs aren't helping me much.

I created an excel macro and looked through that, but I'm unable to
translate it python. There's stuff about selecting shape objects and
then using the ScaleWidth method. Can't make it work.



More information about the Python-win32 mailing list