473,320 Members | 1,910 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,320 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 36253
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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...

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.