progress 9.1D
Hi,
I've got a procedure than produces an excel report. At the end of this program the excel processes are still running. Now the code below shows how I create and release my com objects.
Now I'm pretty sure I've got the order right when it comes to releasing the com objects.
What I'm not sure about is the fact that I'm creating several chBorder objects and releasing only one? Could that be the problem? If it is a problem is there a simple way of releasing multiple chBorder objects without hard-coding it?
Hi,
I've got a procedure than produces an excel report. At the end of this program the excel processes are still running. Now the code below shows how I create and release my com objects.
Code:
CREATE "Excel.Application" chExcelApplication.
chExcelApplication:Visible = FALSE.
chWorkbook = chExcelApplication:Workbooks:Add().
chWorkSheet = chExcelApplication:Worksheets(1).
chBorder = chWorkSheet:Range("A2").
/* do some stuff with the borders */
chBorder = chWorkSheet:Range("B2").
/* do some stuff with the borders */
/* release com-handles */
IF VALID-HANDLE(chBorder) THEN RELEASE OBJECT chBorder.
IF VALID-HANDLE(chWorksheet) THEN RELEASE OBJECT chWorksheet.
IF VALID-HANDLE(chWorkbook) THEN RELEASE OBJECT chWorkbook.
IF VALID-HANDLE(chExcelApplication) THEN RELEASE OBJECT chExcelApplication.
ASSIGN
chBorder = ?
chWorksheet = ?
chWorkbook = ?
chExcelApplication = ?.
Now I'm pretty sure I've got the order right when it comes to releasing the com objects.
What I'm not sure about is the fact that I'm creating several chBorder objects and releasing only one? Could that be the problem? If it is a problem is there a simple way of releasing multiple chBorder objects without hard-coding it?