I'm currently trying to create a vi to add rows to a table based on the amount of data I'm trying to print to the table. The problem I'm running into is passing the for loop constant 'i' into the 'add row' and 'edit cell' sub vi's. I can create a constant or control for the (row, column) parameter, but can't unbundle and rebundle the constant/control to include the 'i' for the row number. Anyone have any ideas how to manipulate this?
Passing 'i' into the first integer block in the (0,0) cluster
Solved! Go to Solution.
Create the constant, delete the wire, add "Bundle By Name", wire the constant to the input, select "Row", wire i to Row.
Well, I often tell my colleagues who ask me for LabVIEW advice "What are you trying to do?". They then proceed to tell me How they are trying to accomplish their goal.
It sounds to me that possibly "What" you want to do is to insert a 2D Array of data (with N rows and who-knows-how-many-columns) into (and probably at the end) of an Excel page. I've done this often, and use Excel Easy Table to do this.
If you had attached your VI (instead of a static picture of a tiny part of your code), I could have verified this and made a more informed recommendation. Doing the addition "all at once" is defiinitely easier to write and much easier to read and understand than doing it one cell at a time ...
If you want more advice (from me), attach your VI.
Just to emphasise Bob's point:
If "What" you want to do is to insert a number of consecutive empty rows that may (or may not) be filled with data at some later point, you can use the ActiveX Range.Insert method to do them all at once rather than having to use a loop. There's a little more code involved but it may be quicker, particularly for a large number of rows.