Progress_Guy
Member
Hi folks,
We do alot of reports to Excel and find we are able to use it to a quite advanced level.
We tend to :-
However, I have a scenario where I want to make it visible (which I can do) and allow the user to populate it (which I can also do) and allow him/her to use standard Excel to save, print and close it.
However, when the user closes it (by physically closing Excel), it still leaves a dead session in the background. If I release and delete my objects then the Excel session closes down straight away before the user can manipulate it.
If I don't clear the handles up then the dead session remains !!
Here is my code for tidying up. Is there any of this that I can miss out (or additional command to add) that'll leave an Excel session, but, be disjoint from Progress.
(Usually I also have code to close down sheets and quit Excel).
RELEASE OBJECT chactiveworksheet NO-ERROR. /* Active Sheet */
RELEASE OBJECT chactiveworkbook NO-ERROR. /* WorkBook */
RELEASE OBJECT chExcelApplication NO-ERROR. /* Excel itself */
Many Thanks in advance.
We do alot of reports to Excel and find we are able to use it to a quite advanced level.
We tend to :-
- Open the Excel session
- Keep it hidden in the background
- Populate (or read it)
- Allow user to save it, print, etc. - by sending relevant commands from Progress
- Close it and tidy up all handles (release and delete them).
However, I have a scenario where I want to make it visible (which I can do) and allow the user to populate it (which I can also do) and allow him/her to use standard Excel to save, print and close it.
However, when the user closes it (by physically closing Excel), it still leaves a dead session in the background. If I release and delete my objects then the Excel session closes down straight away before the user can manipulate it.
If I don't clear the handles up then the dead session remains !!
Here is my code for tidying up. Is there any of this that I can miss out (or additional command to add) that'll leave an Excel session, but, be disjoint from Progress.
(Usually I also have code to close down sheets and quit Excel).
RELEASE OBJECT chactiveworksheet NO-ERROR. /* Active Sheet */
RELEASE OBJECT chactiveworkbook NO-ERROR. /* WorkBook */
RELEASE OBJECT chExcelApplication NO-ERROR. /* Excel itself */
Many Thanks in advance.