The write() method tries to figure out what type of thing you're putting in the spreadsheet cell (number, formula, string, date, etc.), and one of your data fields is apparently confusing it. Just use the writestring() method to force it to be a string value rather than attempting to treat it as a formula. (There are other variations for other data types, too. Read perldoc Spreadsheet::WriteExcel for details.
...roboticus
Update: After re-reading the node, I notice that you're writing a row at a time, rather than a cell at a time. You may want to create your own function to write a row, and call that. Something like (untested):
sub write_row { my $worksheet = shift; my $row = shift; my $col = 0; while (my $cell = shift) { if ($cell =~ /"/) { $worksheet->writestring($row, $col++, $cell) + } else { $worksheet->write($row, $col++, $cell) } } }
Update 2: Fixed a couple typographical errors.
In reply to Re: csv 2 excel
by roboticus
in thread csv 2 excel
by hagmgoe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |