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()
> (
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
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
Hi,
I'm working on something with mysql and excel.
I'm using python and win32com. All major function works, But I have two
problems:
1. the output need to do "auto fit" to make it readable.
I tried to call "xlApp.Columns.AutoFit=1" the whole program will crash,
but without xlApp.Columns.AutoFit