BCX COM Interface

BCX_GET_COM_ERROR_CODE function

Purpose: BCX_GET_COM_ERROR_CODE returns a numeric value specifying an error(HRESULT).


 Syntax:

 RetVal% = BCX_GET_COM_ERROR_CODE 

 Parameters:

  • RetVal% returns a numeric value specifying an error(HRESULT).

Example:


 CLS
 
 DIM app AS OBJECT 
 app = CREATEOBJECT("Excel.Application")
 
 IF BCX_COM_ERROR THEN 
 PRINT "COM ERROR CODE: ", STR$(BCX_GET_COM_ERROR_CODE) 
 END
 END IF 
  
 app.visible = true
 
 Sleep(2000) ' Excel will be visible for 2 sec, and than it will close.
 
 app.activeworkbook.saved = true ' don't prompt to save workbook
 
 app.quit
 
 SET app = NOTHING ' remember to call Set xxx = Nothing to release resources used by COM object!!! 
 
 
 KEYPRESS

For more examples of the BCX COM functions see the COM folder in the Files section of the BCX Group on Yahoo.

Related topics: Object data type definition | BCX_GET_COM_ERROR_CODE | List of all COM Interface Functions