01-01-2014 08:46 PM
Hello All.
I am using excel in my program writing data into it an excel workbook and then later on reading data from it. I have written down the code of closing excel worlkbook and shutting down excel application hence releasing the handles for it. But when i do that i.e. when the code containing excel workbook closing and excel application shutting down executes, excel workbook is closed but excel process does not end properly and can be seen in the task manager. And when i repeatedly open the excel file through my front end interface and close the file, another excel process is added in the task manager which does not end and so on. What can be the problem and solution. Thanks in advance.
Best Regards.
Moshi.
01-01-2014 11:20 PM
Hello,
I've got similar problem when writing code in Matlab.
Then I noticed that I use Matlab with another excel workbook simultaneously. The excel end command can close only one workbook in the time. If another one is open too it will not perform correctly. Make sure that no any other workbook is open - perhaps it works similarly in LabView as in Matlab.
brgs,
Przemo
01-02-2014 04:45 AM
Interfacing to Excel via ActiveX may be tricky, ending in situations like the one you are facing now.
The basic principle is that every single handle opened to an Excel object (workbook, worksheet, range, variant and so on) must be closed properly for the entire process to terminate gracefully. If a reference remains unhandled at program end you will find an instance of Excel remaining in the task list and you may suffer erratic behaviour in subsequent accesses to the product.
You must double check all references and add approporiate dispose/close commands for every one of them.