By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,245 Members | 1,241 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,245 IT Pros & Developers. It's quick & easy.

win32::OLE

P: 4
Hi all,

i am trying to run the following code


Expand|Select|Wrap|Line Numbers
  1.  
  2. use strict;
  3. use Win32::OLE qw(in with);
  4. use Win32::OLE::Const 'Microsoft Excel';
  5. $Win32::OLE::Warn = 3;                                # die on errors...
  6. my $Excel = Win32::OLE->GetActiveObject('Excel.Application')
  7.     || Win32::OLE->new('Excel.Application', 'Quit');  # get already active Excel
  8.                                                       # application or open new
  9. my $Book = $Excel->Workbooks->Open("C:\\DOCUMENTS\\test.xls"); # open Excel file
  10. my $Sheet = $Book->Worksheets(1);                     # select worksheet number 1
  11. $last_row = $sheet -> UsedRange -> Find({What => "*", SearchDirection => xlPrevious, SearchOrder => xlByRows}) -> {Row};
  12. my $array = $Sheet->Range("A4:B$last_row")->{'Value'};        # get the contents
  13. $Book->Close;
  14.  
  15.  
i am getting the following error

Win32::OLE object version 0.1701 does not match $Win32::OLE::VERSION 0.1703 at C
:/Perl/lib/DynaLoader.pm line 185.
Compilation failed in require at C:\OLE\ole.pl line 2.
BEGIN failed--compilation aborted at C:\OLE\ole.pl line 2.

can anybody tell me what this error means?

Thnaks in advance.
Mar 31 '08 #1
Share this Question
Share on Google+
1 Reply


numberwhun
Expert Mod 2.5K+
P: 3,503
Hi all,

i am trying to run the following code


Expand|Select|Wrap|Line Numbers
  1.  
  2. use strict;
  3. use Win32::OLE qw(in with);
  4. use Win32::OLE::Const 'Microsoft Excel';
  5. $Win32::OLE::Warn = 3;                                # die on errors...
  6. my $Excel = Win32::OLE->GetActiveObject('Excel.Application')
  7.     || Win32::OLE->new('Excel.Application', 'Quit');  # get already active Excel
  8.                                                       # application or open new
  9. my $Book = $Excel->Workbooks->Open("C:\\DOCUMENTS\\test.xls"); # open Excel file
  10. my $Sheet = $Book->Worksheets(1);                     # select worksheet number 1
  11. $last_row = $sheet -> UsedRange -> Find({What => "*", SearchDirection => xlPrevious, SearchOrder => xlByRows}) -> {Row};
  12. my $array = $Sheet->Range("A4:B$last_row")->{'Value'};        # get the contents
  13. $Book->Close;
  14.  
  15.  
i am getting the following error

Win32::OLE object version 0.1701 does not match $Win32::OLE::VERSION 0.1703 at C
:/Perl/lib/DynaLoader.pm line 185.
Compilation failed in require at C:\OLE\ole.pl line 2.
BEGIN failed--compilation aborted at C:\OLE\ole.pl line 2.

can anybody tell me what this error means?

Thnaks in advance.

Sorry, I don't know the answer but hopefully one of our experts will be able to assist you.

My appologies for the delay in getting an answer to your question.

Regards,

Jeff
Apr 17 '08 #2

Post your reply

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