#!/usr/bin/perl -w
use strict;
use Win32::OLE qw(in with);
use Win32::OLE::Const 'Microsoft Excel';
$Win32::OLE::Warn = 3; # die on errors...
# get already active Excel application or open new
my $Excel = Win32::OLE->GetActiveObject('Excel.Application')
|| Win32::OLE->new('Excel.Application', 'Quit');
# open Excel file
my $Book = $Excel->Workbooks->Open("u:/file.xls");
my $Book1 = $Excel->Workbooks->Open("u:/v3.xls");
# select worksheet number 1 (you can also select a worksheet by name)
my $Sheet = $Book->Worksheets(1);
my $Sheet1 = $Book1->Worksheets(1);
my $val1;
my $cnt=0;
my $line;
foreach my $row (1..3000)
{
foreach my $col (1)
{
my $val;
next unless defined $Sheet->Cells($row,1)->{'Value'};
$val = $Sheet->Cells($row,1)->{'Value'};
#findl($val);
for($cnt=1;$cnt<=65536;$cnt++){
$val1 = $Sheet1->Cells($cnt,1)->{'Value'};
if ((defined $val1) && (index($val1,$val) != -1)){
$line =$cnt if (!defined $line);
$Sheet->Cells($row,2)->{'Value'}=1;
last;
}
}
}
}
$Book->SaveAs ("u:/new_name.xls") ;
# clean up after ourselves
$Book->Close;
$Book1->Close;
What is the procedure to execute this script which uses WIN32 OLE
Can't locate Win32/OLE.pm in @INC (@INC contains: /usr/lib/perl5/5.8.0/cygwin-mu
lti-64int /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/cygwin-multi-64int
/usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl .) at ./newfile.pl line
4.
BEGIN failed--compilation aborted at ./newfile.pl line 4.
You turned a perl script into a .exe? That doesn't really work. (There's utilities to do it, but they're all awful at it.) Why did you think that would help? The problem, like the error message flat-out tells you, is the missing OLE module, install it.
You don't have to really convert perl scripts to a binary form. You can however "bind" them inside an executable like in this project project: Openkore.com � Index page. I have also tried compiling with the whole scripts included as well. The only problem is that the compiler is only usable in trials. The program used is perlapp from activeperl.