0
votes

I'm using Win32::OLE::Const->Load() in perl :

$xl = Win32::OLE::Const->Load('Microsoft Excel');

then I test if scalar(keys %{$xl}) is zero :

 if (scalar(keys %{$xl})==0) {
        return False;
    }
    else {
        return True;
    }

I tested this code in machine which supports Microsoft Excel 2003 it gives True, but when I tested the same code in machine where there is Microsoft Excel 2013 it gives me False!

I also printed the scalar(keys %{$xl} in the first machine it gives 2023, in the second machine it is 0!

Best Regards

1
which version of perl are you using on the two machines?Håkon Hægland
@HåkonHægland in machine where there is Excel 2013 the version is (v5.26.3) MSWin64 in the other is (v5.16.3) MSWin32-x86Arthur
what does print ref $xl,"\n" give you?Håkon Hægland
@HåkonHægland it gives nothing, I also tried to print $xl in the machine where the keys are defined it gives HASH(...) in the other one it gives nothingArthur

1 Answers

1
votes

after searching I found the solution.

it gives 0 in the second machine cuz there is no win32 Excel key in the registre.

the solution is adding win32 key in HKEY_CLASSES_ROOT\TypeLib\{00020813-0000-0000-C000-000000000046}\1.8\0\