[EMAIL PROTECTED] wrote:
> im trying to use Spreadsheet::ParseExcel::Simple to return the name
> of the worksheet.
> but all i get is something such as:
> Spreadsheet::ParseExcel::Simple::_Sheet=HASH(0x39b8918)
> 
> what am i doing wrong?
> 
> code:
> 
> use strict;
> use Spreadsheet::ParseExcel::Simple;
> my $wkbook = "x:/traffic/temp_assay/site.xls";
> 
> my (@sheets,$dest,$sheet,$year,$date,@wktemp,$ath,$bth,$cth);
> my $xls = Spreadsheet::ParseExcel::Simple->read("$wkbook");
> foreach my $sheet ($xls->sheets) {
>       @sheets = $xls->sheets;
>       while ($sheet->has_data) {
>       my @data = $sheet->next_row;
>       my $sheet = $sheets[0];
>       print "$sheet\n";
> }
> 
> thanks
> 
> Antonio Quinonez

        I pulled this from the doc as a sample script. I ran it on my machine and it 
gave me the right name.

my $oExcel = new Spreadsheet::ParseExcel;    #1.1 Normal Excel97
my $oBook = $oExcel->Parse('myspread.xls');
my($iR, $iC, $oWkS, $oWkC);
print "FILE  :", $oBook->{File} , "\n";
print "COUNT :", $oBook->{SheetCount} , "\n";
print "AUTHOR:", $oBook->{Author} , "\n";
for(my $iSheet=0; $iSheet < $oBook->{SheetCount} ; $iSheet++) {
    $oWkS = $oBook->{Worksheet}[$iSheet];
    print "--------- SHEET:", $oWkS->{Name}, "\n";
    for(my $iR = $oWkS->{MinRow} ; 
            defined $oWkS->{MaxRow} && $iR <= $oWkS->{MaxRow} ; $iR++) {
        for(my $iC = $oWkS->{MinCol} ;
               defined $oWkS->{MaxCol} && $iC <= $oWkS->{MaxCol} ; 
               $iC++) {
               
            $oWkC = $oWkS->{Cells}[$iR][$iC];
            print "( $iR , $iC ) =>", $oWkC->Value, "\n" if($oWkC);
            
        }
    }
}

Wags ;)


**********************************************************
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for 
the express purpose(s) described therein.
Any other use is prohibited.
****************************************************************


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to