#!/usr/bin/perl -w use strict; use Spreadsheet::WriteExcel; my $workbook  = Spreadsheet::WriteExcel->new('c:\test.xls'); my $worksheet = $workbook->addworksheet(); my $format1 = $workbook->addformat(); my $format2 = $workbook->addformat(); my $format3 = $workbook->addformat(); my $format4 = $workbook->addformat(); my $format5= $workbook->addformat(); my $format6 = $workbook->addformat(); my $format7 = $workbook->addformat(); my $format8 = $workbook->addformat(); my @cell_format = ( 'TEXT', 'STANDARD', '#.##', '#.## ¤', '#.## ¤ / # ¤', 'PLZ', 'TT.MM.JJJJ', 'TT.MM.JJ' ); $format1->set_num_format('@'); $format2->set_num_format('0'); $format3->set_num_format('0.00'); $format4->set_num_format('0.00 ¤'); $format5->set_num_format('0 ¤'); $format6->set_num_format('00000'); $format7->set_num_format('dd.mm.yyyy'); $format8->set_num_format('dd.mm.yy'); my $i = -1; $worksheet->write(0, $i++, $_) for (@cell_format); $worksheet->write_string(1, 0, '0123', $format1); $worksheet->write_number(1, 1, '0123', $format2); $worksheet->write(1, 2, '0123', $format3); $worksheet->write(1, 3, '0123', $format4); $worksheet->write(1, 4, '0123', $format5); $worksheet->write(1, 5, '01234', $format6); $worksheet->write(1, 6, '22.6.1980', $format7); $worksheet->write(1, 7, '1.12.1900', $format8); $workbook->close();