> Hi,
>
> I am unable to get the name of the cells in my excel worksheet
though I can get those of my workbook and my worksheet. I have named my
workbook as > > 'myworkbook', my worksheet as 'myworksheet, and cell A1 as
'mycell'.I am using the following code:
[[snip]]
sub readExcel($)
{
use Spreadsheet::ParseExcel;
my $strInfile = shift;
my $source_excel = new Spreadsheet::ParseExcel;
my $source_book = $source_excel->Parse($strInfile) or die "Could not
open source Excel file $strInfile: $!";
my $storage_book;
foreach my $source_sheet_number (0 .. $source_book->{SheetCount}-1)
{
my $source_sheet =
$source_book->{Worksheet}[$source_sheet_number];
# sanity checking on the source file: rows and columns
should be sensible
next unless defined $source_sheet->{MaxRow};
next unless $source_sheet->{MinRow} <=
$source_sheet->{MaxRow};
next unless defined $source_sheet->{MaxCol};
next unless $source_sheet->{MinCol} <=
$source_sheet->{MaxCol};
# Loop through all of the rows
foreach my $row_index ($source_sheet->{MinRow} ..
$source_sheet->{MaxRow})
{
# Loop through the cells, or get the value
of a specific cell
$cell =
$source_sheet->{Cells}[$row_index][0]->Value;
}
}
}
HTH
-Erich-
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs