Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I'm working on automating some reporting taking data from oracle and copying into excel via OLE using Perl. I can copy a data set to a new sheet, or to a defined range in an existing sheet, but I'd like to be able to copy data from a data set to a range defined by the scalar size of the array to be copied.
# Read data from excel my $array = $sheet -> Range("A2:C7") -> { 'Value' }; # Copy data into excel (add using a script) foreach my $line (@$array) { for (my $row = 0; $row < (scalar(@$array)+1); $row++) { foreach my $element (@$line) { for (my $col = 0; $col < scalar(@$line); $col++) { $sheet -> Cells(($row+10),($col+1)) -> {Value} = @$element [$c +ol]; } } } }
This script gives the following error: "Can't use string ("Delivered") as an ARRAY ref while "strict refs" in use at perl_ole.pl line 38." -- line 38 being the line above that starts "$sheet ->".
Thanks for the help, JoeCode tags added by GrandFather
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Copying data sets of varying size into excel using OLE
by Corion (Patriarch) on Sep 08, 2010 at 17:26 UTC | |
by Anonymous Monk on Sep 08, 2010 at 17:56 UTC | |
by Corion (Patriarch) on Sep 08, 2010 at 17:59 UTC | |
by dasgar (Priest) on Sep 08, 2010 at 18:14 UTC | |
by Anonymous Monk on Sep 08, 2010 at 20:52 UTC | |
by ww (Archbishop) on Sep 08, 2010 at 22:25 UTC | |
|