in reply to Perl Excel Help
I'm far from sure what you want, but I'll try anyway. However, let me start by stating my assumptions.
The following code works for me. If you make the assignments in lines 11 and 13 the same, you will get "Found" printed.
use strict; use warnings; use Win32::OLE; my $xl = Win32::OLE->new('Excel.Application'); $xl->{SheetsInNewWorkbook} = 2; $xl->{Visible} = 1; my $wb = $xl->Workbooks->Add; my $cellSource = $wb->Sheets(1)->Cells(1,1); $cellSource->{Value} = 1; my $cellTarget = $wb->Sheets(2)->Cells(2,2); $cellTarget->{Value} = 2; my $addFound = $wb->Sheets(2)->Cells->Find({ What => $cellSource->{Value}, LookIn => -4163 #xlValues }); if ($addFound) {print "Found\n"} else {print "Not found\n"}
Regards,
John Davies
|
|---|