can somebody help me. I'm trying to read some excel files but i'm always getting this error
No type library matching "Microsoft Excel" found at D:\Genes_datase ts\exp.pl line 4
Win32::OLE(0.16 ): GetOleTypeLibOb ject() Not a Win32::OLE::Typ eLib object at C:/Perl/site/lib/Win32/OLE/Const.pm line 45.
Died at D:\Genes_datase ts\exp.pl line 6.
i don't ve microsoft excel but open office installed, i think that could be a problem. But these files ve been saved in microsoft excel 97/2000/XP format
my code is
[CODE=perl]
use strict;
use Win32::OLE;
use Win32::OLE qw(in with);
use Win32::OLE::Con st 'Microsoft Excel';
# get already active Excel application or open new
my $Excel = Win32::OLE->GetActiveObjec t('Excel.Applic ation')|| die;
# storing the names of excel files present in the folder
my $dir="D:/Genes_datasets/";
opendir (DH, $dir) or die "cannot open the $dir !!!";
my @dir_files=read dir DH;
closedir DH;
my @excel_files=gr ep(/.xls/,@dir_files);
#print "@excel_files\n ";
# reading all excel files
foreach (@excel_files) {
open Excel file
my $excelfile=$dir .$_;
print "$excelfile \n";
my $book = $Excel->Workbooks->Open($excelfil e);
my $sheet= $book->Worksheets("Sh eet1");
$sheet->Activate();
my $rowval = $sheet->Range("a1")->{Value};
print "$_\t$rowval\n" ;
}
[/CODE]
No type library matching "Microsoft Excel" found at D:\Genes_datase ts\exp.pl line 4
Win32::OLE(0.16 ): GetOleTypeLibOb ject() Not a Win32::OLE::Typ eLib object at C:/Perl/site/lib/Win32/OLE/Const.pm line 45.
Died at D:\Genes_datase ts\exp.pl line 6.
i don't ve microsoft excel but open office installed, i think that could be a problem. But these files ve been saved in microsoft excel 97/2000/XP format
my code is
[CODE=perl]
use strict;
use Win32::OLE;
use Win32::OLE qw(in with);
use Win32::OLE::Con st 'Microsoft Excel';
# get already active Excel application or open new
my $Excel = Win32::OLE->GetActiveObjec t('Excel.Applic ation')|| die;
# storing the names of excel files present in the folder
my $dir="D:/Genes_datasets/";
opendir (DH, $dir) or die "cannot open the $dir !!!";
my @dir_files=read dir DH;
closedir DH;
my @excel_files=gr ep(/.xls/,@dir_files);
#print "@excel_files\n ";
# reading all excel files
foreach (@excel_files) {
open Excel file
my $excelfile=$dir .$_;
print "$excelfile \n";
my $book = $Excel->Workbooks->Open($excelfil e);
my $sheet= $book->Worksheets("Sh eet1");
$sheet->Activate();
my $rowval = $sheet->Range("a1")->{Value};
print "$_\t$rowval\n" ;
}
[/CODE]
Comment