in reply to Error in excel reader
use strict; use warnings; use Win32::OLE; use feature 'say'; my $Excel = Win32::OLE->new('Excel.Application'); $Excel->{Visible} = 1; my $Book = $Excel->Workbooks->Add; for my $nSht (2..$Book->Sheets->{Count}) { $Book->Sheets(2)->Delete; } my $Sheet = $Book->Sheets(1); say $Sheet->UsedRange->Find('Go'); $Sheet->Cells(3,4)->{Value} = 'Go'; say $Sheet->UsedRange->Find('Go')->Address; $Excel->{DisplayAlerts} = 0; $Excel->Quit;
You may be over-complicating things. The only real complication in the SSCCE above is that Find returns undef if it fails. That is the difference in my two say statements - an undefined object cannot have an address. You may need to test for this, but I don't have your files and so can't know.
Regards,
John Davies
|
|---|