Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Adding a new row in excel file

by Anonymous Monk
on Aug 17, 2009 at 20:02 UTC ( [id://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?

Replies are listed 'Best First'.
Re: Adding a new row in excel file
by ramrod (Curate) 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
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (10)
As of 2024-04-19 09:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found