The ABAP key word FREE OBJECT releases the storage space required for the object
obj. The object can then no longer be processed.The return value of SY-SUBRC specifies whether the desired object was released or not.
Object successfully released.
SAP GUI communication error.
Error when calling function in SAP GUI.
The OLE function modules are only implemented under Windows.
FREE OBJECT belongs to a group of key words that allows you to process external objects with ABAP. At present, only the object model OLE2 is supported, i.e. all objects must be of type OLE2_OBJECT. This type and other necessary data are defined in the INCLUDE module OLE2INCL.

Release an EXCEL object:
INCLUDE OLE2INCL.
DATA: EXCEL TYPE OLE2_OBJECT.
CREATE OBJECT EXCEL 'Excel.Application'.
FREE OBJECT EXCEL.
Related topics are:
SET PROPERTY, GET PROPERTY, CALL METHOD and CREATE OBJECT.