LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Table control and excel

Hello everyone,

 

              We  can load table control to an excel sheet,no doubt. I'm able to do it. But now my question is can I load it to specific cell range of excel sheet? i.e say I have to put my table from D17 to J30. 

 

Note : I'm saving table control to excel using write to spreadsheet and read from spreadsheet.

Thanking you,
Sushmith
0 Kudos
Message 1 of 8
(2,663 Views)

Hi sushmith,

 

don't use the words "Excel" and "Write to Spreadsheet File" in the same sentence. A spreadsheet file is just a plain text with some simple formatting codes...

 

When you use WriteToSpreadsheetFile you have to arrange your data in the 2D array to fit your needs. Attach empty rows/columns to "move" your data to column D (4th column) and row 17 (16th row)...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(2,634 Views)

Hi,

 

      Sorry. I'm loading my table control values to excel. using write to spreadsheet file. So I had mention both at a time. 

 

      Attaching empty rows and columns can be done. But say I have datas already written in a spreadsheet file. Now I need to put value at the end of previous values or in between. Then I can't go for attaching empty row or column right? 

Thanking you,
Sushmith
0 Kudos
Message 3 of 8
(2,627 Views)

Right!

 

You need to load the CSV file then and replace the values in between before saving it again. Attaching data at the end is easier: just attach at end of file...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 8
(2,624 Views)

Hi,

 

      Thank you for your kind response. Loading the csv is fine, but how to replace values in between? For example if my csv file is having datas say from A1 to z30. Now I have a new table of 10 rows and 2 columns. I need to put this in same csv sheet in F10:F20 and G10:G20. How can I go with this? Please suggest me if you have some examples of similar code. 

Thanking you,
Sushmith
0 Kudos
Message 5 of 8
(2,621 Views)

Hi sushmith,

 

you handling an array of data. Simply use ReplaceArraySubset to replace some subsets of your array...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 8
(2,618 Views)

Hi, 

 

     Replace Array subsets can be used. But it can be used to replace value from a table am I right? But now say, I have two tables one with just 10x 2 and one more 30 x 26. I have already uploaded 30 x 26 array in csv, but i have got one more table of 10 x 2 which should be placed in between as I said earlier. 

Thanking you,
Sushmith
0 Kudos
Message 7 of 8
(2,614 Views)

Hi sushmith,

 

if you would dig into the Array functions palette you would notice that there are more functions available than just BuildArray and ReplaceArraySubset.

 

To "put something in between" you could use InsertIntoArray. Sometimes it really helps to read the context help while hovering the mouse over the functions palette...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 8
(2,597 Views)