OLE Errors

The Win32::OLE extension supplies a method to query any error that the preceding action on a COM object might have produced. Every interaction with a COM object (a call into a method or a query or setting of a property) will set the error state, even if no error was generated. Therefore, you must always query the error state before any other interaction with any COM object.

The error state is obtained with a call into the LastError() method:

Win32::OLE–>LastError(); 

The LastError() method will return a value based on context. If the method is called in a numeric context, the returned value is the reported error number. If the method is called in a string context, the return value is the error text message.

This method always returns ...

Get Win32 Perl Programming: The Standard Extensions, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.