Highlighted
Absent Member.
Absent Member.
1072 views

[archive] For the sample

[Migrated content. Thread originally posted on 10 March 2003]

CREATE @Application OF @Excel HANDLE IN EXCEL-APP.
MODIFY EXCEL-APP @SheetsInNewWorkBook = 1.
MODIFY EXCEL-APP @GetOpenFilename()
GIVING FIELD.

MODIFY EXCEL-APP @Workbooks::Open(FIELD)
GIVING EXCEL-WORKBOOK.

********* MODIFY EXCEL-APP @VISIBLE = 1.
inquire EXCEL-WORKBOOK
@Worksheets::item(1) in EXCEL-WORKSHEET.

DESTROY EXCEL-WORKSHEET.
DESTROY EXCEL-WORKBOOK.
DESTROY EXCEL-APP.

THE EXCEL IS STILL IN MEMORY AND WITH THE OPEN WORKSHEET
0 Likes
3 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] For the sample

Is this supposed to be a question?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] For the sample

I want to now why excel his still in memory because i did destroy and after the destroy he is keeping a lock on the file and have it in memory?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] For the sample

I don't see what you have defined FIELD as, but I presume it is not that part that causes your experience. But rather the fact that you do not A) Close the workbook and B) Shut down Excel, which you have to.

I suggest you modify this part:

DESTROY EXCEL-WORKSHEET.
DESTROY EXCEL-WORKBOOK.
DESTROY EXCEL-APP.

To:

DESTROY EXCEL-WORKSHEET.
MODIFY EXCEL-WORKBOOK @Close(0).
DESTROY EXCEL-WORKBOOK.
MODIFY EXCEL-APP @Quit().
DESTROY EXCEL-APP.

And I would expect it to clean up nicely.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.