The information in this article applies to:
SUMMARYWhile automating an Office application, you might receive a large error value such as -2147221494. Troubleshooting the error is greatly facilitated by determining the exact description of the error. This article discusses several methods of obtaining the error messages associated with these large error values. MORE INFORMATIONThese large error values are known as HRESULTs and are defined in the header file Winerror.h. The numbers are so large because the first bit represents whether the number is an error result. You can use one of the following methods to obtain a description for the error. Use the Error Lookup UtilityYou can use the Error Lookup (ErrLook.Exe) utility that comes with Visual C++ to get meaningful descriptions of these errors:
Use FormatMessage() at Run-TimeIf you want to programmatically obtain a description for an error, you can call the FormatMessage() API. For sample code and information about using FormatMessage(), please click the article numbers below to view the articles in the Microsoft Knowledge Base:Q186063 INFO: Translating Automation Errors for VB/VBA Q122957 SAMPLE: Decode32 and Decode16 OLE Error Code Decoder Tools Q94999 FormatMessage() Converts GetLastError() Codes Use the Watch Window While DebuggingIf you are using Visual C++ 6.0, you can use the watch window to display the error message for an HRESULT. You can add an HRESULT to the Watch Window and append ", hr" (without the quotes) to it to have Visual C++ translate the error for you.Additional query words:
Keywords : kbAutomation kbOutlook98 kbVC400 kbVC500 kbVC600 kbGrpDSO kbOffice2000 kbDSupport kbOffice97 kboffice95 |
Last Reviewed: September 23, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |