ungalnanban has asked for the wisdom of the Perl Monks concerning the following question:

I have used Spreadsheet::WriteExcel for creating spreadsheet report.
I tried to merge some cells using merge_range() function.
$worksheet->merge_range(3,5,9,4,$title, $format); [OR] $worksheet->merge_range('E3:I4',$title, $format); $worksheet->write('F6',"LANGUAGE",$format);
it shows the error message like the following

Error: refer to merge_range() in the documentation. Can't use previously merged format in non-merged cell


How to solve this error. if I used write() functions that time only it shows the above error.
if I didn't used any write functions that time cells are merged.
  • Comment on How to merge cells using Spreadsheet::WriteExcel using Merge_range function ?
  • Download Code

Replies are listed 'Best First'.
Re: How to merge cells using Spreadsheet::WriteExcel using Merge_range function ?
by Corion (Patriarch) on Jul 14, 2010 at 09:30 UTC

    I guess the error message is right. You can't reuse a format for a nonmerged that you have already used on a merged cell.

    I guess you need to declare a second format for unmerged cells.

      Thanks Corion Now its working fine. thanks for your immediate replay