LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

excel close refnum order

Solved!
Go to solution

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.

0 Kudos
Message 1 of 5
(2,576 Views)
Solution
Accepted by topic author pjr1121

Did you Quit the Application?

0 Kudos
Message 2 of 5
(2,574 Views)

Try close Workbook before closing its reference.

 

close workbook.png

0 Kudos
Message 3 of 5
(2,563 Views)

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.

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 4 of 5
(2,556 Views)

Thanks alot.  I was under the foolish assumpiton that closing the refnum was enough.

 

 

0 Kudos
Message 5 of 5
(2,546 Views)