(Fwd) Re: Formatting Excel cells with PythonCOM

P.J.W.S. Vrijlandt P.J.W.S.VRIJLANDT at INT.azg.nl
Wed Apr 19 11:02:47 CEST 2000


On  6 Apr 00 at 23:45, Mark Hammond wrote:

> This code is from the win32com test suite (in testMSOffice.py)
> 
>  # 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()
> 

I recently found a problem with this (I didn't run the test suite
though). On my computer (Win95, Excel2000), the NumberFormat propery
only accepts setting the time in my locale's language (i.e. Dutch).
This is rather unfortunate, because the macrorecorder writes in
English.
Patrick Vrijlandt




More information about the Python-list mailing list