LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

excel easy table issues

I am trying to create aconfig file that I write and read using activeX and the report generation vis for excel.  I am trying to use the append table to report or the Easy table.vi and am having issues.

If I run the vi by itself (shown in picture 2), it works great.  All the data is insterted into the table as expected.  However, if i run it from my main vi (as needed for the program, see picture 1), it does not save the data correctly.  I used probes and indicators and found out that all the data is going into the subvi, but it is nno longer getting transfered to my excel sheet (c:\extech config.xls).

My program is usung a producer consumer template, with the save config vi in the consumer loop.  I have a wait ms 100 clock for the while loop of both loops (producer and consumer). 

I also check in the save config.vi (while running my program) and all the data is transfered to the append table or the easy table vis from the proerty nodes, through the build array and transpose array, but that is as far as the data makes it.

Am I missing something with the easy vis???  I would prefer to not have to write my own activex controlled vi to enter the data into excel.

Kenny
Kenny

Download All
0 Kudos
Message 1 of 10
(4,762 Views)
From your picture is does not appear that you are handling any errors from the subVI, so you might want to check the error out to see if that points you to the problem. I can think of no reason why your VI would work by itself and not as a subVI without anything else changing (like the path of the report). In order to be able to offer any more advice, I would need to be able to debug the code myself, so if you could post the subVI with the simplest of calling VIs to illustrate the behavior, I am certainly willing to take a look at it.
 
Kind Regards,
E. Sulzer
Applications Engineer
National Instruments
0 Kudos
Message 2 of 10
(4,727 Views)
Yea, I realized yesterday at the Labview Developers day that I forgot to wire through the error checking.  But I did that this morning and everything appears to go through with no error (other than my data is not transfered).
 
I am thinking that it may be with my loading the data sequence, it appears to not kill the excel.exe process after it loads the data.  Maybe it is holding a reference opne somewhere and not allowing my write to excel to work.
 
Can you take a look at my load vis and see if I missed a reference somewhere (I cant find it, but this is my first time using ActiveX.)
 
I atached a pic of where the vis are used to help understand them, thought I think I commented them well enough.
 
thanks.
 
Kenny
Kenny

0 Kudos
Message 3 of 10
(4,719 Views)
Kenny,
I'm not quite how your second and first post are tied together, but I think you'll need to verify that the data you are intending to put into your excel spreadsheet is actually getting there. You've already completed the first step by verifying that your subvi works stand alone. The next step is have the subvi open and in highlight execution while it is running as a part of the main vi. Verify that the data is getting correctly passed through the subvi while it is part of the main. Let us know what you find.
 
Chris C
0 Kudos
Message 4 of 10
(4,691 Views)
Ok, I'll try to explain a little better.
 
My export data subvi appears to be getting all the correct data, by itself and in the main vi.  I did the highlight execution after my first post in the main vi and all the data was being fed into the Append Table to report.vi (or the Excel Easy Table, I tried both).  So it appears that my export data vi is working correctly.
 
The issue I think I am having is with my import data vi.  I opened the Task Manager to watch the processes, and noticed that after I read the data from excel in my main vi, it kept excel.exe open, which might be preventing my Export data from working correctly (because there is a reference still open from the import data, ie excel did not close).  I could not find a reference that was still open (I think this is the problem, but I cannot confirm), so I posted my import data vi in the last post hoping you could spot a problem.
 
Kenny
Kenny

0 Kudos
Message 5 of 10
(4,686 Views)

Kenny,
I see what you're saying. Thanks for clarifying. It looks like you're calling Application.quit at the end of your program. Do you notice Excel closing before the rest of your program continues?

Also, there are some great example programs in the LabVIEW help (help>>find examples).

I did find two reference you aren't closing (although I don't think it will make a difference). in the excel used range.vi, you have a range.count (reference to columns) that isn't closed. Also in exel read data.... you have a range.value (reference to cells) that isn't closed. Again, I don't think this will make a difference but I may be wrong.

Chris C

 

0 Kudos
Message 6 of 10
(4,662 Views)

I modified my vi after looking over the excel example.  I tried to copy it as much as I could, but I seem to have missed something again.  I made sure that all of the references were closed, but it still leaves excel.exe running.

I am dumbfounded as to where the problem is.

it does make it visible and not visible, passing no errors through the vi, but it appears to not quit (although there is not error through the application quit invoke node)

I ran the excel example and it does open excel.exe and then close it.

Kenny

Kenny

0 Kudos
Message 7 of 10
(4,650 Views)
Kenny,
So I narrowed down the problem to the _workbook.Activesheet property node. If you don't call this property then excel closes down just fine. I'm not real sure what to replace it with or why it's the problem, but at least we know where the issue is now. Let us know if you confirm that this is the problem.
 
Chris C
 
0 Kudos
Message 8 of 10
(4,634 Views)

I was able to resolve the issue.  I modified a vi i found on the forums.

The vi does not use the activesheet property node.

thanks for your help.

 

Kenny

Kenny

0 Kudos
Message 9 of 10
(4,633 Views)
Kenny,
Thanks so much for posting the solution you came up with! It's folks like you that make this a great community!
 
Chris C
 
 
0 Kudos
Message 10 of 10
(4,625 Views)