[Tutor] Format columns in Excel

Terje Johan Abrahamsen terjeja@hotmail.com
Thu, 13 Jun 2002 18:48:38 +0000


I am trying to change a column in Excel with Win32Com. So far I have tried 
this:

class chkxl:
    xlApp = Dispatch("Excel.Application")
    xlApp.Workbooks.Open("agent.xls")
    agent = xlApp.Workbooks("agent.xls").Sheets("Sheet1")
def __init__(self):
    chkxl.agent.Columns(10).Style.Name = "number"

(There is more to it, so for example chkxl.agent.Cells(2,2).Value = "Hello" 
works)

The style.Name = "number" I found with the helper in Excel. It is supposed 
to work in VBA, but doesn't seem to work in Python. What would I write to 
get it to make the column into numbers?

Thanks,
Terje



_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com