Obtaining OLE Automation Error Text

This sample shows you how to get the associated error message text when you receive one of those pesky, cryptic OLE Automation errors. OLE Automation errors can occur for any number of reasons when working with ActiveX components, creating objects,... Knowing the reason the error was raised is a definite plus in solving the problem.

Extract the error message text for OLE Automation errors.
Download Source Code

The core of this program is the FormatMessage API to which I pass in the error number along with the FORMAT_MESSAGE_FROM_SYSTEM flag. In return, FormatMessage gives the text associated with the error code.


Enter an OLE Automation error number in either hex or decimal and click the button.

About TheScarms
About TheScarms

Sample code
version info

If you use this code, please mention "www.TheScarms.com"

Email this page

© Copyright 2016 TheScarms
Goto top of page