in reply to OLE VB to Perl
No error handling I know but it gives you an idea and I've run this on NT4.0 with Office 98.use strict; use Win32::OLE; # Open excel. my $excel = Win32::OLE->new("Excel.Application", 'Quit'); # Create a workbook. my $excelBook = $excel->Workbooks->Add; # Enumerate the sheets in the workbook (sheet1,sheet2,sheet3 by defaul +t). my $sheets = Win32::OLE::Enum->new($excelBook->Worksheets()); #Iterate the sheets using the All() function. foreach my $sheet ($sheets->All()) { print $sheet->name() . "\n"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
RE: RE: OLE VB to Perl
by Mike McClellan (Novice) on Jul 13, 2000 at 23:48 UTC | |
by jehuni (Pilgrim) on Jul 23, 2001 at 19:37 UTC |