Hi,
I m facing a problem to add an array as a comment to a MS excel cell using Spreadsheet :: WriteExcel .
I m using the below code
above script reads the contents of the specified text file and takes it in to an array @contents and writes it to the secified cell (ie is 10 th row 2nd column ) using write_comment method .
But executing this i got the following output .
Uneven number of additional arguments at s4.pl line 11.
also the last line $workbook->close(); is not executed after that .
Could anyone help me how to add an array or a filehandle in a MS excel cell comment .
I m facing a problem to add an array as a comment to a MS excel cell using Spreadsheet :: WriteExcel .
I m using the below code
Code:
use Spreadsheet::WriteExcel;
$workbook = Spreadsheet::WriteExcel->new('perl.xls');
$worksheet = $workbook->add_worksheet();
print "\n \n Enter a path value to take its contns \n";
$pth=<STDIN>;
chomp $pth;
$pth =~ tr#\\#/#;
open(MF, "$pth" ) || die "$!";
@contents = <MF>;
close(MF);
$worksheet->write_comment(10, 2, @contents);
$workbook->close();
above script reads the contents of the specified text file and takes it in to an array @contents and writes it to the secified cell (ie is 10 th row 2nd column ) using write_comment method .
But executing this i got the following output .
Uneven number of additional arguments at s4.pl line 11.
also the last line $workbook->close(); is not executed after that .
Could anyone help me how to add an array or a filehandle in a MS excel cell comment .
Comment