At 7:19 AM -0700 4/26/10, Jim Gibson wrote:
At 1:37 AM -0700 4/26/10, luke devon wrote:
Hi #!/usr/bin/perl -w use strict; use Spreadsheet::ParseExcel; my $parser = Spreadsheet::ParseExcel->new(); my $workbook = $parser->parse('Book1.xls'); Like this , as per examples, we could open/read the existing excel files.but how can we execute other functions which are exclude in the Spreadsheet::ParseExcel. Like .... delete sheet , delete row, adding data ...etc. For that task , do we need to call Spreadsheet::WriteExcel package? Can somebody help me on this please?

Unfortunately, you cannot do that. ParseExcel reads Excel spreadsheets (but only the older format). WriteExcel writes files that can be read and edited with Excel. However, the two modules are not compatible, in that you cannot apply both to the same file.

What you will have to do if you want to add data to an existing spreadsheet is open the spreadsheet and read the contents using ParseExcel, create a new spreadsheet with WriteExcel, and copy all of the data from the existing spreadsheet document to the new one. That can be tedious.

Another approach, if you are working on Windows, is to control the Excel application from a Perl program using one of the OLE modules from CPAN, e.g. Win32::OLE.

--
Jim Gibson
j...@gibson.org

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to