Sergey's observation may limit your choices. You could look for a wrapper, or, you could create an excel object and leave it's visible property .f.
oldOnError=on('error')
ON ERROR oExcel=.NULL.
oExcel=getobject(,'Excel.Application')
ON ERROR &oldOnError
IF isnull(oExcel)
oExcel=createobject('Excel.Application')
ENDIF
Your automation script can drive an invisible excel object.
>Hi everybody!
>When I run a form and I would like add an object from the class that is defined programmatically with codes following:
>
>DEFINE CLASS oleExcelObject as OLEControl
> OleClass ="Excel.Sheet" && Server name
> DocumentFile = "test.xls" && This file must exist
>ENDDEFINE
>thisform.AddObject("Excel", "oleExcelObject ")
>
>
>I set these codes in init method or another method , I get an error.
>How to add object from define class when the form runtime?
>Please help me.
>Thanks
>Canh
Imagination is more important than knowledge