LPARAMETERS tcApplication LOCAL llOK, loApp, lcHandler, loErr, lcMsg llOK = .T. TRY Thisform.oApp = CREATEOBJECT( tcApplication + [.Application] ) CATCH TEXT TO lcMsg TEXTMERGE NOSHOW PRETEXT 3 It seems that <<tcApplication>> is not installed on the computer. You must have <<tcApplication>> installed to run this process. ENDTEXT MESSAGEBOX( lcMsg, 64, Major WAAAAAHHHHH!] ) llOK = .F. ENDTRY IF llOK *********************************************************************** *** Changed By.: Marcia G. Akins on 14 January 2006 *** Reason.....: Now see if we have 2K, XP, 2003, or 2007 *********************************************************************** IF INLIST( ALLTRIM( Thisform.oApp.version ), [9.0], [10.0], [11.0], [12.0] ) *** sonstruct the name of the handler to use lcHandler = tcApplication + [Handler] + ICASE( [9.0], [2K], [10.0], [XP], [11.0], [2003], [12.0], [2007] ) + [.prg] ) TRY loHandler = NEWOBJECT( tcApplication + [Handler], lcHandler ) CATCH TO loErr IF loErr.ErrorNo = 1 && File does not exist TEXT TO lcMsg TEXTMERGE NOSHOW PRETEXT 3 The System is unable to find <<lcHandler>>. Please select <<lcHandler>> in the open file dialog when it appears. Sorry for the inconvenience... ENDTEXT MESSAGEBOX( lcMsg, 64, [Major WAAAHHHHH!] ) lcHandler = GETFILE( [prg], [Automation Handler], [Select], 0, [Find Handler] ) IF NOT EMPTY( lcHandler ) Thisform.oHandler = NEWOBJECT( tcApplication + [Handler], lcHandler ) ELSE llOK = .F. ENDIF ELSE && loErr.ErrorNo = 1 && File does not exist TEXT TO lcMsg TEXTMERGE NOSHOW PRETEXT 3 The following error occurred when trying to instantiate the automation handler from <<lcHandler>>: <<loErr.Message>> ENDTEXT MESSAGEBOX( lcMsg, 64, [Major WAAAHHHHH!] ) llOK = .F. ENDIF && loErr.ErrorNo = 1 && File does not exist ENDTRY ELSE && INLIST( ALLTRIM( loApp.version ), [9.0], [10.0], [11.0], [12.0] ) TEXT TO lcMsg TEXTMERGE NOSHOW PRETEXT 3 You must have at least version either 2000 of <<tcApplication>> installed to run this process. ENDTEXT MESSAGEBOX( lcMsg, 64, [Major WAAAHHHH!] ) llOK = .F. Thisform.oApp.quit() ENDIF && INLIST( ALLTRIM( loApp.version ), [9.0], [10.0], [11.0], [12.0] ) ENDIF RETURN llOK