LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Excel sheet operations in labview

Hi guys, i am trying to add first and second column of an excel sheet and i want to write it to the third column of the same sheet. Anyway, i managed to do it, it worked. However, it gives error now. What are the possible reasons for that?

Download All
0 Kudos
Message 1 of 2
(3,310 Views)

There are multiple things "wrong" with your code.  Here are a few of them:

  • You should (almost) never use a Stacked Sequence!  Do you see all those error lines going backward and forward?
  • You should (almost, but not as strictly as the above) never use Sequences -- use Data Flow instead (here, the Error Line is your friend).
  • You should (almost) never use Local Variables, particularly when you can use a Shift Register and a wire to do the same thing.
  • I don't understand Case 0.  Are you just looking for the first zero in your data?  A sub-VI (with a label) or a Free Label would be so helpful.
  • Do you understand the difference between Excel (a Microsoft Program that has a "native" data format that includes the concept of a Workbook and Worksheets) and NI's Read Delimited Spreadsheet function which has very little to do with Excel?
  • If I forget about the Case 0 code but assume that I have an Excel Workbook whose first Worksheet contains two columns of numeric data (both the same length with no gaps), the code to (a) open and read those two columns into Excel, (b) add the two columns together, and (c) write the results in Column 3, saving the modified file should be capable of being done with about 8 functions, and should fit on a single screen with no silly folding of wires through a stacked sequence.  Let's count:
  1. New Report
  2. Excel Get Data
  3. Index Array
  4. Add
  5. Build Array
  6. Excel Easy Table
  7. Save Report to File
  8. Dispose Report

Bob Schor

0 Kudos
Message 2 of 2
(3,261 Views)