LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Excel Remains Resident in Memory

"It seems that exceldemo2000 has the problem of leaving excel resident in memory. This is happening when the following sequence of commands are made:

Once run exceldemo2000,


LaunchExcel,
OpenFile,
Read -> Will show popup [Values returned not of type Double]
Quit.


Can someone please show me where and why excel2000demo is not discarding the objects cause it seems that I am having the same problem and my program is entierly based on this demo.


Thanks
Raphael"
0 Kudos
Message 1 of 5
(3,777 Views)
Hi,

Apparently, you are trying to read data whereas the array in the excel worksheet is empty. If you look at the ReadDataFromExcel function, you will see that one handle (ExcelSingleCellRangeHandle) is not discarded when the function goes on error.

If you read data from an empty worksheet, you must discard this handle at the end of the function.

BMN
0 Kudos
Message 2 of 5
(3,777 Views)
Raphael,

The shipping example Exceldemo2000 you are referring to does have a leak - sometimes it doesn't end of processes it has started. I have a fixed version of the C file you can use (attached) which clears all handles properly. Let me know if this doesn't fix the problem.

Regards,
Azucena
0 Kudos
Message 3 of 5
(3,777 Views)
I have figured out (in my program)that it seems that when the handles have to be reused they must be cleared first and not just overwritten since they would not be reassigned with the correct value.
Don't ask me why but that's what appears to be happening.

Thanks very much for your help.
0 Kudos
Message 4 of 5
(3,777 Views)
Thanks a lot,

You are right. Problem solved
0 Kudos
Message 5 of 5
(3,777 Views)