08-30-2012 06:29 PM
Hello,
I'm trying to use read/write to an Excel file and I'm rather new to activex. Based on an example program, I can read the contents of the sheet. However, afterwards I can not open the file.
From what I can find on the forums, this is a known problem with the order you close the refnums. However, after alot of trial and error, I still can't seem to get it right. Here's what I have at the moment..
open applicaton
open workbooks
open workbook
open sheets
open sheet
activate sheet
get range refnum
get value
close range refnum
close sheet refnum
close sheets refnum
close workbook refnum
close workbooks refnum
close application refnum.
Any help would be greatly appreciated. After I read the current data, I want to use another vi to write values. Unfortunately, I can't do this when a refnum from the read VI is still open.
Solved! Go to Solution.
08-30-2012 07:21 PM
Did you Quit the Application?
08-31-2012 12:16 AM
Try close Workbook before closing its reference.
08-31-2012 03:21 AM
Hi Pjr1121,
nyc is right. use Quit Application, it will solve your issue.
When you close Excel the way you are doing it, it will be still running. Check it in Task Manager>>Processes
When you quit application then Excel is completely closed.
All the best.
08-31-2012 09:18 AM
Thanks alot. I was under the foolish assumpiton that closing the refnum was enough.