Re: python win32com excel problem

2007-05-01 Thread NO_SPAM
Bart Willems wrote: > Ray wrote: >> Hi, >> I tried to call "xlApp.Columns.AutoFit=1" the whole program will crash, >> but without xlApp.Columns.AutoFit=1, everything just fine. > > Autofit is a method. Also, columns are a method of a worksheet - try: > xlApp.Worksheets.Columns("C:K").Autofit() > (

Re: python win32com excel problem

2007-05-01 Thread Bart Willems
Bart Willems wrote: > Autofit is a method. Also, columns are a method of a worksheet - try: > xlApp.Worksheets.Columns("C:K").Autofit() Silly me. That is of course xlApp.Activesheet.Columns("C:K").Autofit() On a sidenote, you can refer to a worksheet with xlApp.Worksheets(Name) as well. -- http

Re: python win32com excel problem

2007-05-01 Thread Bart Willems
Ray wrote: > Hi, > I tried to call "xlApp.Columns.AutoFit=1" the whole program will crash, > but without xlApp.Columns.AutoFit=1, everything just fine. Autofit is a method. Also, columns are a method of a worksheet - try: xlApp.Worksheets.Columns("C:K").Autofit() (or whatever columns you need of c