LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

excel process does not end properly

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.

0 Kudos
Message 1 of 3
(4,733 Views)

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

0 Kudos
Message 2 of 3
(4,726 Views)

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.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 3 of 3
(4,715 Views)