473,381 Members | 1,399 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,381 software developers and data experts.

Win32::OLE error - No type library matching "Microsoft Excel" found

1
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_datasets\exp.pl line 4
Win32::OLE(0.16): GetOleTypeLibObject() Not a Win32::OLE::TypeLib object at C:/Perl/site/lib/Win32/OLE/Const.pm line 45.
Died at D:\Genes_datasets\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

Expand|Select|Wrap|Line Numbers
  1. use strict;
  2. use Win32::OLE;
  3. use Win32::OLE qw(in with);
  4. use Win32::OLE::Const 'Microsoft Excel';
  5. # get already active Excel application or open new
  6. my $Excel = Win32::OLE->GetActiveObject('Excel.Application')|| die;
  7.  
  8. # storing the names of excel files present in the folder
  9. my $dir="D:/Genes_datasets/";
  10. opendir (DH, $dir) or die "cannot open the $dir !!!";
  11. my @dir_files=readdir DH;
  12. closedir DH;
  13. my @excel_files=grep(/.xls/,@dir_files);
  14. #print "@excel_files\n";
  15.  
  16. # reading all excel files
  17. foreach (@excel_files) {
  18.     open Excel file
  19.     my $excelfile=$dir.$_;
  20.     print "$excelfile\n";
  21.     my $book = $Excel->Workbooks->Open($excelfile);
  22.     my $sheet= $book->Worksheets("Sheet1");
  23.     $sheet->Activate();
  24.     my $rowval = $sheet->Range("a1")->{Value};
  25.     print "$_\t$rowval\n";
  26. }
  27.  
Jul 23 '07 #1
8 36327
numberwhun
3,509 Expert Mod 2GB
Unfortunately I don't have experience trying to read Excel files with Perl, but wonder if Excel should be installed for this to work? You may be correct in that assumption. If you can install it, it couldn't hurt to try it. If it works, let us know.

Regards,

Jeff
Jul 23 '07 #2
KevinADC
4,059 Expert 2GB
i don't ve microsoft excel but open office installed,
what is open office?
Jul 23 '07 #3
numberwhun
3,509 Expert Mod 2GB
Open Office is the open source "equivelant" of M$ Office. It is available on a number of platforms and now comes standard with many Linux distributions. I use it exclusively on my Linux machines as it is able to easily read and write M$ Office files, at least I haven't had any issues.

Unfortunately, I wonder if he/she is correct that the module is looking for and calling something(s) from the Excel installation.

Regards,

Jeff
Jul 23 '07 #4
KevinADC
4,059 Expert 2GB
Seems obvious, if they don't have Excel installed they can't try and use it to process the file.

On the other hand, there appears to be a number of Open Office modules posted on cpan.
Jul 23 '07 #5
It is very obvious.

The Win32:OLE module allows your code to talk to any MS Windows OLE application that is available on the system from where you are running your code.

This clearly indicates that
* You must be running your code from an MS Windows machine
* You must have the OLE application (in this case Excel) setup on your machine


An easier solution would be to write the data in a comma seperated value (csv) format into a file with .csv extension and then open it in any spreadsheet program

Hope this helps

-Dilip
Jul 25 '07 #6
HaoRan
1 Bit
If you have installed excel, see if you are using a 64-bit version, if so, please add a win32 registry, the same content as win64.

Registry position: \HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TypeLib\{0002 0813-0000-0000-C000-000000000046}\1.9\0\win32
Aug 4 '23 #7
dew075732
2 2Bits
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
Aug 4 '23 #8
EggyUen
1 Bit
It works! I also found the win32::ole error for my software after windows system upgrading. It seems the operation delete excel registry of Win32. With HaoRan‘s suggestion, I finally fix the glitch.
Aug 15 '23 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Bill Davy | last post by:
sys.path: H:\Husky\HostPC\V1\SHIP\Debug H:\Husky\HostPC\V1\SHIP E:\Bill\Python-2.4.1\PCbuild\python24_d.zip C:\Python24\Lib C:\Python24\DLLs C:\Python24\Lib\lib-tk H:\Husky\HostPC\V1\RunSHIP...
2
by: Blake | last post by:
Windows 2000 Active Directory, IIS 5 ASP code looks like this: Set oUser = GetObject("WinNT://DOMAIN/" & strNTName) oUser.ChangePassword strPassword, strNewPassword If (err.number <> 0)...
3
by: Big Dave | last post by:
Hello All, I was wondering wether anyone could help me solve what is probably a very easy issue. I keep getting this damn "The administrative limit for this request was exceeded" whenever I try to...
11
by: Vijay Chegu | last post by:
I have built a 64bit ATL COM dll. When i register the dll on IA64 windows Enterprise server 2003, i get following error. DllRegisterServer in mydll.dll failed. Return code was : 0x80020009 ...
3
by: Gustavo L. Fabro | last post by:
Greetings! I'm testing VS 2005 Beta 2, and I've compiled a program that runs just fine on my computer (where VS is installed). I've tried to run this same program on another computer (after...
1
by: Tom | last post by:
I can't debug my asp.net projects. for some reason i'm getting an error saying that i don't have permission and i should be added to the debuggers group. I added my domain user, my aspnet user and...
7
by: STUPIDFORUM | last post by:
ADODB.Recordset "The connection cannot be used to perform this operation." "Microsoft Access Driver" ERROR 0X800A0E7D OLE exception from "ADODB.Recordset": The connection cannot be used to...
2
by: lialie | last post by:
Hi, Maybe it 's quite simple, but I can't fix it. Do I make some mistakes in my env setting? My excel version is 2003. any suggestion? Thanks. Traceback (most recent call last): File...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.