On 7/16/07, a_arya2000 <[EMAIL PROTECTED]> wrote:
By the way, my file size around 22 MB so, is it
possible that Spreadsheet::WriteExcel::Big is not good
enough for this size?
snip
What follows is a test script you can use to determine if it is your
code or Spreadsheet::WriteExcel::Big (or possibly Excel) that is at
fault. When run it will create a file that is roughly 21 megs in
size. The size can be increased or decreased by modifying
$string_size. If Excel can open the file then your code is at fault,
if it gives you the same error then your version of either
Spreadsheet::WriteExcel::Big or Excel has a bug.
#!/usr/bin/perl
use strict;
use warnings;
use Spreadsheet::WriteExcel::Big;
my $string_size = 300;
my $wb = Spreadsheet::WriteExcel::Big->new('test.xls');
my $ws = $wb->add_worksheet();
for my $row (1 .. 65536) { #every row in an excel spread sheet
$ws->write("A$row", rand_str($string_size));
}
$wb->close;
sub rand_str {
my $size = shift;
my @a = ('A' .. 'Z', 'a' .. 'z', 0 .. 9);
return join '', map { $a[int rand @a] } 1 .. $size
}
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/