in reply to Re: Using Excel in Perl failure after OS re-install
in thread Using Excel in Perl failure after OS re-install

Thank you
I tried you suggestion but got the following error on the failing PC

Perl v5.28.0

Win32::OLE Version 0.1712 Win32::OLE(0.1712) error 0x800401f3: "Invalid class string" at line with my $excel = Win32::OLE->new('Excel.Application') or die Win32::OLE->LastError();

However on the PC where the test works, you suggestion also works.
The Perl version and Win32:OLE version were the same on both PCs.

Have you any idea why the systems are giving different results?
  • Comment on Re^2: Using Excel in Perl failure after OS re-install

Replies are listed 'Best First'.
Re^3: Using Excel in Perl failure after OS re-install
by poj (Abbot) on Mar 03, 2019 at 14:38 UTC

    Do both PCs have the same version of Excel ?

      ..good question!
      I have just realised that on the failing PC the line
      printf "Excel %s\n",$excel->{'version'};
      gave nothing at all - however on the successful PC I got Excel 14.0
      I used the same disc for both PCs (I am in the process of replacing the old PC for a new one).
      On both PCs Excel is stored in same directory .../Office14.
      Therefore I thought I had but one does not seem to be 'recognised'.
        ..more about the versions.
        Going to the Help where it gives more details about the version, I find that the Version: number and Product ID are different on the 2 PCs.
        Could this be significant?
Re^3: Using Excel in Perl failure after OS re-install
by merrymonk (Hermit) on Mar 03, 2019 at 14:36 UTC
    ...an update If i remove the last section of the $excel line so that it is
    my $excel = Win32::OLE->new('Excel.Application') ;
    it does not give the Class error but neither does it work.