natty_dread has asked for the wisdom of the Perl Monks concerning the following question:
Here's the script I'm trying... use strict; use Win32::OLE; my $excel = Win32::OLE-> new ('Excel.Application', 'Quit') or die ("Ca +n't create object: ", Win32::OLE->LastError()); my $file = 'C:\EndPoint scripts\test.xls'; my $workbook = $excel->Workbooks->Open(@file) or die ("Can't open Work +book: ", Win32::OLE->LastError()); my $worksheet = $workbook->Worksheets(1); my $range = $worksheet->Range("A1:B2") -> {'Value'}; $workbook -> close; foreach my $row (@$range) { foreach my $cell (@$row) { print "$cell\t"; } print "\n"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Unable to Extract Data from Excel
by Jaap (Curate) on Oct 26, 2003 at 11:50 UTC | |
by natty_dread (Acolyte) on Oct 26, 2003 at 12:01 UTC | |
by Anonymous Monk on Jun 13, 2007 at 01:20 UTC | |
Re: Unable to Extract Data from Excel
by PERLscienceman (Curate) on Oct 26, 2003 at 11:45 UTC |