Excel Activex in VL-WIN Check if open

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
Posts: 497
Joined: Wed Jan 20, 2016 7:38 am

Excel Activex in VL-WIN Check if open

Post by atostaine » Fri Mar 08, 2019 3:52 am

I am creating a spreadsheet using code like this:

* start Excel
Set_Ref Com(#ExcelApp) To(*CREATE_AS #VV_EXCEL.Application)
* Create worksheet
#ExcelApp.Workbooks.Add Template(-4167) Add_Retval(#ExcelWorkbook)
Set_Ref Com(#ExcelWorksheet) To(*Dynamic #ExcelApp.ActiveSheet)

I have routines to set Excel to *Null, but the user is closing the spreadsheet using the "X". That leaves my Excel reference open. Is there an event I can use know they closed it?

How can I check if excel is open and active?
Art Tostaine

Post Reply