in reply to Inserting copied rows at another position in Excel

How would
Range("A39").Select Selection.Insert Shift:=xlDown
become
$selection = $sheet->Rows("1:9"); print "$selection\n"; $sheet->Range("A39")->$selection->Insert;
? Selection/$selection is an object, not a method

Both of these show a select/insert operation: site:perlmonks.org ole excel copy insert -> Inserting copied rows in Excel using Win32::OLE

Office Automation with Perl

Replies are listed 'Best First'.
Re^2: Inserting copied rows at another position in Excel
by merrymonk (Hermit) on Mar 01, 2011 at 11:45 UTC
    I looked at the references but as far as I can see they do not show an exmaple of where the selected rows are inserted at another position given by a Range (or perhaps Rows).
    It would be good to know if my $selection statement does what I hoped it would do - that is the equivalent of selecting the rows sepecified.
    As another trial I did try
    $sheet->Range("A39") = $selection
    but this gave the following error
    Can't modify non-lvalue subroutine call at insert_rows.pz line 16.