Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Adding a new row in excel file

by Anonymous Monk
on Aug 17, 2009 at 20:02 UTC ( #789264=perlquestion: print w/ replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi

I have been using Spreadsheet::ParseExcel and Spreadsheet::WriteExcel to read and write excel workbooks, respectively.

Spreadsheet::WriteExcel can only be used for creating new excel spreadsheets. I am looking for a module that would/should help me in appending to existing excel files. Adding new rows to the existing worksheets of an excel file is one such typical requirement of mine.

I tried searching in http://search.cpan.org and came across Spreadsheet::ParseExcel::SaveParser which is supposed to be an integration of ParseExcel and WriteExcel. But this does not help me either.

Could someone help me out here?

Comment on Adding a new row in excel file
Re: Adding a new row in excel file
by ramrod (Hermit) on Aug 17, 2009 at 20:18 UTC
    Try Spreadsheet::SimpleExcel
    I found it has both add_row (per documentation)
    # append data to 'NAME' $excel->add_row('NAME',[qw/new row/]);
    and add_row_at (per documentation)
    # add a row into the middle $excel->add_row_at('Name of Worksheet',1,[qw/new row/]);
Re: Adding a new row in excel file
by Bloodnok (Vicar) on Aug 17, 2009 at 20:19 UTC
    You could use the tried and tested Win32::OLE library - I have to admit to previously not having an awful lot of luck with the libraries you mention and resorted to said library [Win32::OLE] with a fair degree of success.

    A user level that continues to overstate my experience :-))
Re: Adding a new row in excel file
by jrsimmon (Hermit) on Aug 17, 2009 at 20:38 UTC
    Use Win32::OLE. It's much more flexible than the other modules that I've looked at. It may take you a bit longer to implement whatever you're doing with it, but the next time something new comes up you'll be much better prepared to add functionality without having to scrape and replace your current solution.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://789264]
Approved by ikegami
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (13)
As of 2014-12-19 13:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (83 votes), past polls