Formatting Excel cells with PythonCOM

Scott sbarron at
Fri Apr 7 16:25:13 CEST 2000

Hi Mark,

Wouldn't you know not 5 minutes after I posted the messag I figured it
out using the Excel VBA help.  Anyway, thanks for the information.  Btw,
I bought and read your PPW over my spring break and it helped me
tremendously, thanks!


Mark Hammond wrote:
> This code is from the win32com test suite (in
>  # test dates out with Excel
>  xl.Cells(5,1).Value = "Excel time"
>  xl.Cells(5,2).Formula = "=Now()"
>  import time
>  xl.Cells(6,1).Value = "Python time"
>  xl.Cells(6,2).Value = pythoncom.MakeTime(time.time())
>  xl.Cells(6,2).NumberFormat = "d/mm/yy h:mm"
>  xl.Columns("A:B").EntireColumn.AutoFit()

More information about the Python-list mailing list