Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^5: Copy paste rows in excel

by davies (Prior)
on Dec 29, 2016 at 23:41 UTC ( [id://1178631]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Copy paste rows in excel
in thread Copy paste rows in excel

Since this is line 2, I can't imagine well organised code including strictures and Win32::OLE in one line. I would bet that Corion has identified a part of your problem. Another, though, is that you are using GetActiveObject. Unless you have a really strong reason to do this (I can imagine a very few), always create your own instance of Excel. I outlined some reasons in Re: Win32-OLE: What is the canonical way to open file for editing?, but there are plenty more and precious few good reasons to take control of an instance of Excel opened for some other purpose.

It's a good idea to create a SSCCE (https://web.archive.org/web/20160926072757/http://sscce.org) to show a problem and a solution. For eight examples, have a look at RFC Tutorial - Deleting Excel Rows, Columns and Sheets, where I show lots of code, each example being complete and opening an instance of Excel. Most of these open the Excel instance and book in the same way, but there are some minor variations. There may be other things there that you could usefully copy.

Regards,

John Davies

Update: you might also like to look at the thread Inserting copied rows at another position in Excel, which contains SSCCEs.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-03-28 13:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found