http://qs321.pair.com?node_id=11137841

ece05 has asked for the wisdom of the Perl Monks concerning the following question:

I am facing some errors related to Win32::OLE. How to resolve this error?..

jre_64_bit=java_jre/1.8.0_275_64

No type library matching "Microsoft Excel" found at .\/MatrixGenerator.pm line 26.

Win32::OLE(0.1709): GetOleTypeLibObject() Not a Win32::OLE::TypeLib object at c:/tools/perl/5.14.4.1_3e_ecl/eclipse/plugins/com.fab.ubk.perlinterpreter/Perl/perl/vendor/lib/Win32/OLE/Const.pm line 49.

Bareword "xlThin" not allowed while "strict subs" in use at .\/MatrixGenerator.pm line 2770.

Bareword "xlEdgeBottom" not allowed while "strict subs" in use at .\/MatrixGenerator.pm line 2770.

Bareword "xlContinuous" not allowed while "strict subs" in use at .\/MatrixGenerator.pm line 2771.

Bareword "xlEdgeBottom" not allowed while "strict subs" in use at .\/MatrixGenerator.pm line 2771.

Bareword "xlAutomatic" not allowed while "strict subs" in use at .\/MatrixGenerator.pm line 2772.

Bareword "xlEdgeBottom" not allowed while "strict subs" in use at .\/MatrixGenerator.pm line 2772.

Compilation failed in require at START_TMG.bat line 43.

BEGIN failed--compilation aborted at START_TMG.bat line 43 (#1)

(F) With "strict subs" in use, a bareword is only allowed as a

subroutine identifier, in curly brackets or to the left of the "=>"

symbol. Perhaps you need to predeclare a subroutine?

Uncaught exception from user code:

Bareword "xlThin" not allowed while "strict subs" in use at .\/MatrixGenerator.pm line 2770.

Bareword "xlEdgeBottom" not allowed while "strict subs" in use at .\/MatrixGenerator.pm line 2770.

Bareword "xlContinuous" not allowed while "strict subs" in use at .\/MatrixGenerator.pm line 2771.

Bareword "xlEdgeBottom" not allowed while "strict subs" in use at .\/MatrixGenerator.pm line 2771.

Bareword "xlAutomatic" not allowed while "strict subs" in use at .\/MatrixGenerator.pm line 2772.

Bareword "xlEdgeBottom" not allowed while "strict subs" in use at .\/MatrixGenerator.pm line 2772.

Compilation failed in require at START_TMG.bat line 43.

BEGIN failed--compilation aborted at START_TMG.bat line 43.

at START_TMG.bat line 43.

Replies are listed 'Best First'.
Re: Error in Win32::OLE
by Corion (Patriarch) on Oct 21, 2021 at 09:55 UTC
    No type library matching "Microsoft Excel" found at .\/MatrixGenerator +.pm line 26.

    Maybe Microsoft Excel is not installed on the machine running your program?

    The rest is just fallout from that, since all the Excel constants are unknown now.

      MS Excel is installed in the PC. I was using the older version at that time

      Now, I am using Microsoft 365. Is this impacting the perl script?

        Maybe Office 365 does not have OLE automation anymore - this seems plausible if Office 365 only runs within the browser, for example.

        Maybe look on your PC whether the type library file is findable and give that to Win32::OLE::Const explicitly.

        The alternative approach if all this fails is to replace all the named constants with their values, which you can acquire from Googling them.

        The latest application versions of Office 365 include OLE blocking. I have no idea if it is turned on by default - I can check sometime as it would be interesting to find out and potentially helpful to you. Here is some information from Microsoft.

        I am pretty certain that the cloud versions of Office 365 do not support OLE. Instead they use the Fluid Framework.