BCX COM Interface
BCX_SHOW_COM_ERRORS statement
Purpose: BCX_SHOW_COM_ERRORS
controls
behavior of error reporting routine. If set to TRUE, message will
popup on each COM error with descriptive string from last COM error.
If set to FALSE(default), message will NOT popup, but error
information still can be retrieved using one of the error reporting
functions.
Syntax: BCX_SHOW_COM_ERRORS(boolParam) Parameters:
|
Remarks: If the COM code is used in applications similar to cgi exe, that run on web servers or remote computers, popping of error message on that computer is not wanted.
Example:
CLS BCX_SHOW_COM_ERRORS(FALSE) ' don't display error 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 = trueSleep(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_DESC | List of all COM Interface Functions