kgnickl has asked for the wisdom of the Perl Monks concerning the following question:
SOLUTION: Adding a new variable and setting that variable equal to $key + 0....$worksheet = $workbook->Worksheets("Worksheet"); foreach my $key (sort keys %hash){ print "Key: $key\nValue: $hash{$key}\n"; $worksheet->Cells($current_row, $key)->{Value} = $hash{$key}; }
$worksheet = $workbook->Worksheets("Worksheet"); foreach my $key (sort keys %hash){ print "Key: $key\nValue: $hash{$key}\n"; $column = $key + 0; $worksheet->Cells($current_row, $column)->{Value} = $hash{$key}; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Can't use an undefined value as a hash reference when passing hash key into Excel OLE call.
by davies (Monsignor) on Nov 10, 2011 at 23:07 UTC | |
by kgnickl (Novice) on Nov 11, 2011 at 00:21 UTC | |
by davies (Monsignor) on Nov 11, 2011 at 08:15 UTC | |
|
Re: Can't Use an undefined value as a HASH reference when passing HASH key into Excel OLE call.
by davies (Monsignor) on Nov 13, 2011 at 09:30 UTC |