in reply to Handle Excel cells with the value #N/A in Perl

In Excel VBA, you can call any Excel function (even if it doesn't exist in VBA) via the incantation Application.function(arguments). By extension, therefore, you can access the ISNA function from Perl via something like $oExcel->isna(reference). The following code returns 1 if A1 is #NA:
use strict; use warnings; use diagnostics; use Win32::OLE; my $xl = Win32::OLE->new('Excel.Application'); $xl->{Visible} = 1; my $wb = $xl->Workbooks->Open("c:\\data\\na.xls"); exit 0 if not defined($wb); print $xl->isna($wb->Sheets(1)->Cells(1,1)->Value);
Regards,

John Davies