Thanks all. Your suggestion works.
Furthermore, any idea on formatting the whole Excel worksheet to use Arial font and font size 8 for example.
I tried the following lines, they would not work:
my $Sheet = $Book2->Worksheets($localcounter01);
$Sheet->{Font} = "Arial";
$Sheet->{Size} = 8;
$Sheet->Range($range)->Columns->AutoFit;
Tommy