Hi.
I am trying to resize my columns in Excel through VB6.
I have created my excel.appliation object (xl) and created a new workbook.
Now I want to use the code:
xl.Cells(1, 1).Width = 100, but I get: Unable to set the width property of
the Range class.
Even when I try
xl.Columns(2).Width = 100
I get the same error.
MSRoach@gmail.com - 24 Mar 2006 12:12 GMT
What about:
xl.Columns("A:A").ColumnWidth = 100
(any range) in place of A:A
Stefi - 24 Mar 2006 12:39 GMT
Try
ActiveWorkbook.ActiveSheet.Columns("B:B").ColumnWidth = 100
You can replace ActiveWorkbook and ActiveSheet with other valid WB and WS
references if necessary.
Regards,
Stefi
„Camper Joe” ezt írta:
> Hi.
>
[quoted text clipped - 10 lines]
>
> I get the same error.