in reply to Re: Re: How to resize a column in excel with Win32::OLE
in thread How to resize a column in excel with Win32::OLE


Sorry, that should have been $worksheet->Columns("A:A"). Here is a working example:
#!/usr/bin/perl -w use strict; use Cwd; use Win32::OLE; my $application = Win32::OLE->new("Excel.Application"); my $workbook = $application->Workbooks->Add; my $worksheet = $workbook->Worksheets(1); $worksheet->Cells(1,1)->{Value} = "Hello World"; $worksheet->Columns("A:A")->{ColumnWidth} = 25; # Get current directory using Cwd.pm my $dir = cwd(); $workbook->SaveAs($dir . '/win32ole.xls'); $workbook->Close;

--
John.