Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Inserting copied rows in Excel using Win32::OLE

by jmcnamara (Monsignor)
on Aug 29, 2004 at 00:10 UTC ( [id://386669]=note: print w/replies, xml ) Need Help??


in reply to Inserting copied rows in Excel using Win32::OLE


The correct syntax should probably be (note the anonymous hash ref):
$curSheet->Rows("2:2")->Insert({Shift => 'xlDown'});
However, I've tried this and it doesn't work. I don't know why, perhaps xlDown is superfluous in the context of a row range.

As a workaround, if you use the Insert() method without parameters it will give the desired effect of shifting the rows down:

$curSheet->Rows("2:2")->Insert();


Update: bmann got it below, ++. In addition to the hashref xlDown is an imported constant and shouldn't be quoted. The following works:
$curSheet->Rows("2:2")->Insert({Shift => xlDown});

--
John.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://386669]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-03-29 04:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found