Problems Related to Migrating ActiveX Applications from CTD 1.5.1 to 2.0

From Support Wiki

Jump to: navigation, search
Problems Related to Migrating ActiveX apps from CTD 1.5.1 to 2.0

17 Sept, 2001

Description:

SalActiveXGetActiveObject() returns TRUE intermittently even when Excel is not running..

Solution:

The following steps will solve the problem

   1. Re-Create ActiveX UDV variables in CTD 2.0
   2. SalActiveXGetActiveObject()/CreateObject against the interface class (example-Excel__Application) rather than coclass (example Excel_Appplication)

Here is a code sample that WORKS all the time using interface class.

If Not SalActiveXGetActiveObject(ExcelApp,'Excel Application')
         Call ExcelApp Create Object('Excel Application')
Call ExcelApp.PropSetVisible(TRUE)
Where ExcelApp is defined as Excel__Application: ExcelApp

Here is a code sample that DOES NOT WORK all the time using interface class.

If Not SalActiveXGetActiveObject(ExcelApp,'Excel Application')
         Call ExcelApp Create Object('Excel Application')
Call ExcelApp.PropSetVisible(TRUE)
Where ExcelApp is defined as Excel_Application: ExcelApp

 

Kumuthini Ragavan & Jean-Marc Gemperle
Sr. Technical Support Engineers
Centura Software/GUPTA LLC