alignment excel written in Python

Raymond Hettinger python at
Thu Jun 6 04:50:55 CEST 2002

> I have a questions now: How can I deal with the alignment of Excel from
> Python? for example, put the value in a cell with alignment right, or
> center.

xlLeft, xlRight, xlCenter = -4131, -4152, -4108
from win32com.client.dynamic import Dispatch
xl = Dispatch('Excel.Application')
xl.Range('A1').HorizontalAlignment = xlRight

Raymond Hettinger

More information about the Python-list mailing list