PROGRAM OLE_ExcelDemo; { *************************************************************************** ** Descr. : This script shows how to use OLE/ActiveX. ** In this example we are createing an instance of Microsoft Excel ** and write some stuff on a worksheet and then save it. ** *************************************************************************** ** 04/01/02 1.001.00 Initial Creation, sm@orcl-toolbox.com ***************************************************************************} VAR ExcApp : Variant; ExcDoc : Variant; //Begin Main BEGIN //create the winword object ExcApp := CreateOleObject('Excel.Application'); //add some sheets to the workspace ExcDoc := ExcApp.Workbooks.add; //set field A1 to Hello! ExcApp.Cells[1,1].value := 'Hello!'; //set a range of fields using the VarArrayOf function! ExcApp.Range['B3','E3'].Value := VarArrayOf(['My numbers:', 10, 100, 1000]); //make the application visible ExcApp.Visible := true; //save the workbook! ExcDoc.SaveAs('C:\formsapitest.xls'); END. //End Main