in reply to List of worksheets in an Excel workbook
#!perl use warnings; use strict; use Win32::OLE qw(in); # import "in" my $excel = Win32::OLE->new('Excel.Application', 'Quit'); $excel->{Visible} = 1; # q:\s\test.xls is a new worksheet with three sheets my $xls = $excel->Workbooks->Open('q:\s\test.xls'); foreach my $sheet ( in $xls->Worksheets ) { print $sheet->Name, $/; } __END__ Output: Sheet1 Sheet2 Sheet3
This also works with cells in a range, open workbooks, etc.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: List of worksheets in an Excel workbook
by Anonymous Monk on Jun 08, 2005 at 08:16 UTC | |
by davidrw (Prior) on Jun 08, 2005 at 14:44 UTC | |
by bmann (Priest) on Jun 08, 2005 at 17:32 UTC |